EpcTools
An event based multi-threaded C++ development framework.
|
Go to the documentation of this file.
18 #ifndef __eutil_h_included
19 #define __eutil_h_included
39 static Int
indexOf(cpStr path, Char search, Int start = 0);
44 static Int
indexOfAny(cpStr path, cpStr search);
54 static std::vector<EString>
split(cpStr s, cpStr delims);
81 static void string_format( std::string &dest,
const char *format, ... );
86 static Void
copy_file(
const std::string &dst,
const std::string &src ) {
copy_file( dst.c_str(), src.c_str() ); }
88 static Void
copy_file(
const char *dst,
const std::string &src ) {
copy_file( dst, src.c_str() ); }
90 static Void
copy_file(
const std::string &dst,
const char *src ) {
copy_file( dst.c_str(), src ); }
92 static Void
copy_file(
const char *dst,
const char *src );
102 static Bool
file_exists( cpStr fn ) {
return (access(fn,F_OK)!=-1); }
109 static void _string_format( std::string &dest,
const char *format, va_list &args );
112 #endif // #define __eutil_h_included
static std::string currentTime()
Returns a string representation of the current system time.
Definition: eutil.cpp:146
Macros for various standard C library functions and standard includes.
static Int indexOf(cpStr path, Char search, Int start=0)
Retrieves the byte index of the search value within the supplied path.
Definition: eutil.cpp:25
static Void copy_file(const char *dst, const std::string &src)
Copies the source file to the destination location.
Definition: eutil.h:88
static Void copy_file(const std::string &dst, const std::string &src)
Copies the source file to the destination location.
Definition: eutil.h:86
static std::string string_format(const char *format,...)
Formats a string using the supplied format string. Uses printf format specifiers.
Definition: eutil.cpp:125
Class that contains various utility functions.
Definition: eutil.h:31
static Bool file_exists(cpStr fn)
Determines if the supplied file exists.
Definition: eutil.h:102
static Void delete_file(const std::string &fn)
Deletes the supplied file.
Definition: eutil.h:96
static Int lastIndexOfAny(cpStr path, cpStr search)
Retrieves the last byte index of any of the search values within the supplied path.
Definition: eutil.cpp:54
static EString replaceAllCopy(const EString &str, cpStr srch, size_t srchlen, cpStr rplc, size_t rplclen)
replaces all occurances of the search string in the provided string with the replacement string retur...
Definition: eutil.cpp:99
String class.
Definition: estring.h:30
static Void copy_file(const std::string &dst, const char *src)
Copies the source file to the destination location.
Definition: eutil.h:90
static Int indexOfAny(cpStr path, cpStr search)
Retrieves the byte index of any of the search values within the supplied path.
Definition: eutil.cpp:38
Encapsulates and extends a std::string object.
static EString & replaceAll(EString &str, cpStr srch, size_t srchlen, cpStr rplc, size_t rplclen)
replaces all occurances of the search string in the provided string with the replacement string.
Definition: eutil.cpp:91
static std::vector< EString > split(cpStr s, cpStr delims)
Splits a string into substrings that are based on the characters in the delimiter array.
Definition: eutil.cpp:73