text_buf.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) Sergey P. Derevyago, 2008-2009.
00003  *
00004  * Permission to copy, use, modify, sell and distribute this software is granted
00005  * provided this copyright notice appears in all copies.
00006  * This software is provided "as is" without express or implied warranty, and
00007  * with no claim as to its suitability for any purpose.
00008  *
00009  */
00010 
00015 #include <ders/text_buf.hpp>
00016 #include <stdio.h>
00017 
00018 namespace ders {  // ::ders
00019 
00020 text_buf& text_buf::operator+(int val)
00021 {
00022  char buf[25];
00023  return *this+ch_rng(buf, buf+sprintf(buf, "%d", val));
00024 }
00025 
00026 text_buf& text_buf::operator+(unsigned val)
00027 {
00028  char buf[25];
00029  return *this+ch_rng(buf, buf+sprintf(buf, "%u", val));
00030 }
00031 
00032 text_buf& text_buf::operator+(long val)
00033 {
00034  char buf[50];
00035  return *this+ch_rng(buf, buf+sprintf(buf, "%ld", val));
00036 }
00037 
00038 text_buf& text_buf::operator+(unsigned long val)
00039 {
00040  char buf[50];
00041  return *this+ch_rng(buf, buf+sprintf(buf, "%lu", val));
00042 }
00043 
00044 text_buf& text_buf::operator+(void* ptr)
00045 {
00046  char buf[25];
00047  return *this+ch_rng(buf, buf+sprintf(buf, "%p", ptr));
00048 }
00049 
00050 }  // namespace ::ders
00051 

Generated on Tue Dec 8 11:35:32 2009 for derslib by  doxygen 1.5.5