MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / GetCwd

Function GetCwd

src/OpenColorIO/PathUtils.cpp:131–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129namespace
130{
131std::string GetCwd()
132{
133#ifdef _WIN32
134 char path[MAXPATHLEN];
135 _getcwd(path, MAXPATHLEN);
136 return path;
137#else
138 std::vector<char> current_dir;
139#ifdef PATH_MAX
140 current_dir.resize(PATH_MAX);
141#else
142 current_dir.resize(1024);
143#endif
144 while (::getcwd(&current_dir[0], current_dir.size()) == NULL && errno == ERANGE) {
145 current_dir.resize(current_dir.size() + 1024);
146 }
147
148 return std::string(&current_dir[0]);
149#endif
150}
151}
152
153std::string AbsPath(const std::string & path)

Callers 1

AbsPathFunction · 0.70

Calls 2

resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected