/[escript]/trunk/tools/CppUnitTest/inc/CppUnitTest/estring.h
ViewVC logotype

Annotation of /trunk/tools/CppUnitTest/inc/CppUnitTest/estring.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 155 - (hide annotations)
Wed Nov 9 02:02:19 2005 UTC (17 years, 4 months ago) by jgs
File MIME type: text/plain
File size: 970 byte(s)
move all directories from trunk/esys2 into trunk and remove esys2

1 jgs 82
2     #ifndef CPPUNIT_ESTRING_H
3     #define CPPUNIT_ESTRING_H
4    
5     #include <cstdio>
6    
7     #include "CppUnitTest/CppUnitTestNamespace.h"
8     BEGIN_NAMESPACE_CPPUNITTEST
9    
10     // Create a string from a const char pointer
11     inline std::string estring (const char *cstring)
12     { return std::string (cstring); }
13    
14     // Create a string from a string (for uniformities' sake)
15     inline std::string estring (std::string& expandedString)
16     { return expandedString; }
17    
18     // Create a string from an int
19     inline std::string estring (int number)
20     { char buffer [50]; sprintf (buffer, "%d", number); return std::string (buffer); }
21    
22     // Create a string from a long
23     inline std::string estring (long number)
24     { char buffer [50]; sprintf (buffer, "%ld", number); return std::string (buffer); }
25    
26     // Create a string from a double
27     inline std::string estring (double number)
28     { char buffer [50]; sprintf (buffer, "%f", number); return std::string (buffer); }
29    
30     END_NAMESPACE_CPPUNITTEST
31    
32     #endif
33    
34    
35    
36    

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26