36 #define access _access
46 #ifdef CHECK_MEMORY_LEAKS
48 #endif // CHECK_MEMORY_LEAKS
59 if (path.length() == 0) {
62 while (path[path.length() - 1] ==
'/' || path[path.length() - 1] ==
'\\') {
63 path.erase(path.end() - 1);
65 if (path.length() == 0) {
68 return access(path.c_str(), R_OK) == 0;
77 size_t beg = path.find_last_of(
"\\/");
78 if (beg == std::string::npos || beg == 0) {
81 return path.substr(0, beg + 1);
87 const std::string& path) {
89 return retPath + path;
95 size_t colonPos = name.find(
":");
96 return (colonPos != std::string::npos) && (colonPos > 1);
106 if (path.length() > 0 && path[0] ==
'/') {
110 if (path.length() > 0 && path[0] ==
'\\') {
113 if (path.length() > 1 && path[1] ==
':') {
116 if (path ==
"nul" || path ==
"NUL") {
125 const std::string& basePath) {
126 if (filename ==
"stdout" || filename ==
"STDOUT" || filename ==
"-") {
129 if (filename ==
"stderr" || filename ==
"STDERR") {
144 strm.write((
char*) &value,
sizeof(
int));
151 strm.write((
char*) &value,
sizeof(
unsigned int));
158 strm.write((
char*) &value,
sizeof(
SUMOReal));
165 strm.write((
char*) &value,
sizeof(
char));
172 size_t size = value.length();
173 const char* cstr = value.c_str();
175 strm.write((
char*) cstr, (std::streamsize)(
sizeof(
char)*size));
182 strm.write((
char*) &value,
sizeof(
SUMOTime));