MCPcopy Create free account
hub / github.com/axmolengine/axmol / getPath

Method getPath

core/base/Properties.cpp:968–1001  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

966}
967
968bool Properties::getPath(const char* name, std::string* path) const
969{
970 AXASSERT(name && path, "Invalid name or path");
971 const char* valueString = getString(name);
972 if (valueString)
973 {
974 if (FileUtils::getInstance()->isFileExist(valueString))
975 {
976 path->assign(valueString);
977 return true;
978 }
979 else
980 {
981 const Properties* prop = this;
982 while (prop != NULL)
983 {
984 // Search for the file path relative to the bundle file
985 const std::string* dirPath = prop->_dirPath;
986 if (dirPath != NULL && !dirPath->empty())
987 {
988 std::string relativePath = *dirPath;
989 relativePath.append(valueString);
990 if (FileUtils::getInstance()->isFileExist(relativePath))
991 {
992 path->assign(relativePath);
993 return true;
994 }
995 }
996 prop = prop->_parent;
997 }
998 }
999 }
1000 return false;
1001}
1002
1003const char* Properties::getVariable(const char* name, const char* defaultValue) const
1004{

Callers 5

setTextureMethod · 0.45
getMatchCookieMethod · 0.45
UriTests.cppFile · 0.45

Calls 6

getStringFunction · 0.85
getInstanceFunction · 0.85
isFileExistMethod · 0.45
assignMethod · 0.45
emptyMethod · 0.45
appendMethod · 0.45

Tested by 1