mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-18 10:53:13 +09:00
feature #1483: Moved implementation of util functions to a cc file
This commit is contained in:
1 parent
f4434f00ad
commit
4e41c91022
4 files changed
+60
-30
No files matched your search
+4
-28
@@ -21,37 +21,13 @@
|
||||
|
||||
namespace one_util
|
||||
{
|
||||
inline string& toupper(string& st)
|
||||
{
|
||||
transform(st.begin(),st.end(),st.begin(),(int(*)(int))std::toupper);
|
||||
return st;
|
||||
};
|
||||
std::string& toupper(std::string& st);
|
||||
|
||||
inline string& tolower(string& st)
|
||||
{
|
||||
transform(st.begin(),st.end(),st.begin(),(int(*)(int))std::tolower);
|
||||
return st;
|
||||
};
|
||||
std::string& tolower(std::string& st);
|
||||
|
||||
inline string log_time(time_t the_time)
|
||||
{
|
||||
char time_str[26];
|
||||
std::string log_time(time_t the_time);
|
||||
|
||||
#ifdef SOLARIS
|
||||
ctime_r(&(the_time),time_str,sizeof(char)*26);
|
||||
#else
|
||||
ctime_r(&(the_time),time_str);
|
||||
#endif
|
||||
|
||||
time_str[24] = '\0'; // Get rid of final enter character
|
||||
|
||||
return string(time_str);
|
||||
};
|
||||
|
||||
inline string log_time()
|
||||
{
|
||||
return log_time( time(0) );
|
||||
};
|
||||
std::string log_time();
|
||||
};
|
||||
|
||||
#endif /* UTIL_H_ */
|
||||
Reference in new issue
Block a user