36 #define access _access
45 #ifdef CHECK_MEMORY_LEAKS
47 #endif // CHECK_MEMORY_LEAKS
58 if (path.length() == 0) {
61 while (path[path.length() - 1] ==
'/' || path[path.length() - 1] ==
'\\') {
62 path.erase(path.end() - 1);
64 if (path.length() == 0) {
67 return access(path.c_str(), 0) != -1;
76 size_t beg = path.find_last_of(
"\\/");
77 if (beg == std::string::npos || beg == 0) {
80 return path.substr(0, beg + 1);
86 const std::string& path) {
88 return retPath + path;
94 size_t colonPos = name.find(
":");
95 return (colonPos != std::string::npos) && (colonPos > 1);
105 if (path.length() > 0 && path[0] ==
'/') {
109 if (path.length() > 0 && path[0] ==
'\\') {
112 if (path.length() > 1 && path[1] ==
':') {
115 if (path ==
"nul" || path ==
"NUL") {
124 const std::string& basePath) {
125 if (filename ==
"stdout" || filename ==
"STDOUT" || filename ==
"-") {
128 if (filename ==
"stderr" || filename ==
"STDERR") {
143 strm.write((
char*) &value,
sizeof(
int));
150 strm.write((
char*) &value,
sizeof(
unsigned int));
157 strm.write((
char*) &value,
sizeof(
SUMOReal));
164 strm.write((
char*) &value,
sizeof(
char));
171 size_t size = value.length();
172 const char* cstr = value.c_str();
174 strm.write((
char*) cstr, (std::streamsize)(
sizeof(
char)*size));
181 strm.write((
char*) &value,
sizeof(
SUMOTime));