xref: /phasta/phSolver/common/phString.cc (revision 7acde132a6def0fe2daaec0d1a712dff0e5c6636)
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <cstring>
4 #include <string>
5 #include <sstream>
6 
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 
phstr_appendInt(char * dest,int v)11 void phstr_appendInt(char* dest, int v) {
12   std::stringstream ss;
13   ss << dest << v;
14   std::string s = ss.str();
15   strcpy(dest, s.c_str());
16 }
17 
phstr_appendDbl(char * dest,double v)18 void phstr_appendDbl(char* dest, double v) {
19   std::stringstream ss;
20   ss << dest << v;
21   std::string s = ss.str();
22   strcpy(dest, s.c_str());
23 }
24 
phstr_appendStr(char * dest,char * src)25 void phstr_appendStr(char* dest, char* src) {
26   std::stringstream ss;
27   ss << dest << src;
28   std::string s = ss.str();
29   strcpy(dest, s.c_str());
30 }
31 
32 #ifdef __cplusplus
33 }
34 #endif
35