MCPcopy Create free account
hub / github.com/9miao/CrossApp / getFileString

Method getFileString

CrossApp/platform/CCFileUtils.cpp:118–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118std::string CCFileUtils::getFileString(const char* pszFilePath)
119{
120 std::string data;
121
122 unsigned long pSize = 0;
123 unsigned char* pData = this->getFileData(pszFilePath, "rb", &pSize);
124
125 if (pSize > 0)
126 {
127 data.resize(pSize);
128 memcpy(&data[0], pData, pSize);
129 }
130 return data;
131}
132
133std::string CCFileUtils::getNewFilename(const std::string& pszFileName)
134{

Callers 1

Calls 2

getFileDataMethod · 0.95
resizeMethod · 0.45

Tested by

no test coverage detected