Take the current date string getcurdate () {time_t nowtime; Time (&nowtime);
Take the current time value struct TM *tptr;
Tptr = LocalTime (&nowtime);
Char datestamp[32];
ace_os::sprintf (Datestamp, "%04d%02d%02d", tptr->tm_year+1900, Tptr->tm_mon+1,tptr->tm_mday);
return datestamp;
//Get current time string Getcurtime () {time_t nowtime;
Time (&nowtime);
struct TM *tptr;
Tptr = LocalTime (&nowtime);
Char timestamp[15];
memset (TimeStamp, 0x00, 15);
ace_os::sprintf (TimeStamp, "%02d%02d%02d", tptr->tm_hour,tptr->tm_min,tptr->tm_sec);
return timeStamp;
//int-type string string inttostring (int value) {char tmpstring[15];
memset (tmpstring, 0x00, 15);
sprintf (tmpstring, "%d", value);
return tmpstring;
///To process the string as lowercase. void ToLower (String &strtmp) {for (unsigned int i = 0; i < strtmp.length (); i++) {Strtmp[i] = Tol
Ower (Strtmp[i]);
} return;
///flag the string into ... according to the separator token. int GetItem (string &msg, Char flag, VECTOR<string> &line) {try {if (line.size ()!= 0) {line.clear ();
} if (msg.length () = = 0) {return 0;
} Char *tmpmsg = &msg[0];
int begin = 0;
int end = 0;
string tmp;
for (unsigned int i = 0; i < msg.length (); i + +) {if (tmpmsg[i] = = Flag) {
end = i;
else {continue; } if ((End-begin) > 0) {tmp = string (&tmpmsg[begin], end-be
gin);
else {tmp = "";
begin = End+1;
Line.push_back (TMP); } if ((Msg.length ()-begin) > 0) {tmp = string (&tmpmsg[begin), Msg.length (
)-begin);
Line.push_back (TMP); catch (...)
{Ace_debug (_info ace_text ("GetItem execpaction:[%s].\n"), Msg.c_str ());
return-1;
return 0;
////outputs the contents of the vector. void Dispvector (const vector<string> &vectmp) {if (vectmp.size () = = 0) {ace_debug (_info ace_
TEXT ("Vector is null\n"));
Return for (unsigned int i = 0; i < vectmp.size (); i++) {Ace_debug (_info ace_text ("[%25s]\n"),
Vectmp[i].c_str ()));
} return;
////returns num string strings Laststr (string &from, int num) {if (From.length () <= (unsigned int) num) {
return from;
else {return from.substr (From.length ()-num, num);
} string Leftfullchar (string &from, int count, char flag) {if (From.length () > (unsigned int) count) {
return from;
int fullcount = (int) from.length ()-count;
String strtmp (Fullcount, flag); Strtmp + = from;
return strtmp;
String Rightfullchar (string &from, int count, char flag) {if (From.length () > (unsigned int) count) {
return from;
int fullcount = (int) from.length ()-count;
String strtmp (Fullcount, flag);
return from+strtmp; }