MCPcopy Create free account
hub / github.com/Aloshi/EmulationStation / expandPath

Method expandPath

src/components/ThemeComponent.cpp:309–320  ·  view source on GitHub ↗

expands a file path (./ becomes the directory of this theme file, ~/ becomes $HOME/)

Source from the content-addressed store, hash-verified

307
308//expands a file path (./ becomes the directory of this theme file, ~/ becomes $HOME/)
309std::string ThemeComponent::expandPath(std::string path)
310{
311 if(path.empty())
312 return "";
313
314 if(path[0] == '~')
315 path = getHomePath() + path.substr(1, path.length() - 1);
316 else if(path[0] == '.')
317 path = boost::filesystem::path(mPath).parent_path().string() + path.substr(1, path.length() - 1);
318
319 return path;
320}
321
322//takes a string containing a mathematical expression (possibly including variables) and resolves it to a float value
323float ThemeComponent::resolveExp(std::string str, float defaultVal)

Callers

nothing calls this directly

Calls 3

getHomePathFunction · 0.85
stringMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected