• Home
  • Raw
  • Download

Lines Matching refs:string

30 bool SPUtils::FileAccess(const std::string &fileName)  in FileAccess()
35 bool SPUtils::LoadFile(const std::string &filePath, std::string &content) in LoadFile()
57 bool SPUtils::LoadCmd(const std::string &cmd, std::string &result) in LoadCmd()
59 std::string cmdExc = cmd; in LoadCmd()
77 std::string SPUtils::IncludePathDelimiter(const std::string &path) in IncludePathDelimiter()
86 void SPUtils::ForDirFiles(const std::string &path, std::vector<std::string> &files) in ForDirFiles()
88 std::string pathStringWithDelimiter; in ForDirFiles()
104 pathStringWithDelimiter = IncludePathDelimiter(path) + std::string(ptr->d_name); in ForDirFiles()
107 files.push_back(IncludePathDelimiter(path) + std::string(ptr->d_name)); in ForDirFiles()
113 bool SPUtils::IsSubString(const std::string &str, const std::string &sub) in IsSubString()
119 return str.find(sub) != std::string::npos; in IsSubString()
122 void SPUtils::StrSplit(const std::string &content, const std::string &sp, std::vector<std::string> … in StrSplit()
125 while (index != std::string::npos) { in StrSplit()
127 std::string tmp = content.substr(index, tEnd - index); in StrSplit()
131 if (tEnd == std::string::npos) { in StrSplit()
138 std::string SPUtils::ExtractNumber(const std::string &str) in ExtractNumber()
151 void SPUtils::ReplaceString(std::string &res) in ReplaceString()
153 std::string flagOne = "\r"; in ReplaceString()
154 std::string flagTwo = "\n"; in ReplaceString()
155 std::string::size_type ret = res.find(flagOne); in ReplaceString()
175 std::string SPUtils::GetTopPkgName() in GetTopPkgName()
177 std::string cmd = "hidumper -s AbilityManagerService -a '-a' | grep 'bundle name' | head -n 1"; in GetTopPkgName()
178 std::string curTopPkgStr = ""; in GetTopPkgName()
182 std::string topPkg = curTopPkgStr.substr(left + 1, right - left - 1); in GetTopPkgName()
186 static std::string GetSplitOne(std::string cmd) in GetSplitOne()
188 std::string result; in GetSplitOne()
190 std::vector<std::string> splitStrings; in GetSplitOne()
195 std::map<std::string, std::string> SPUtils::GetDeviceInfo() in GetDeviceInfo()
197 std::map<std::string, std::string> resultMap; in GetDeviceInfo()
198 std::string sn = GetSplitOne("param get |grep ohos.boot.sn"); in GetDeviceInfo()
199 std::string deviceTypeName = GetSplitOne("param get |grep ohos.boot.hardware"); in GetDeviceInfo()
200 std::string brand = GetSplitOne("param get |grep const.product.brand"); in GetDeviceInfo()
201 std::string version = GetSplitOne("param get |grep const.product.software.version"); in GetDeviceInfo()
209 std::map<std::string, std::string> SPUtils::GetCpuInfo() in GetCpuInfo()
211 std::vector<std::string> policyFiles; in GetCpuInfo()
212 std::map<std::string, std::string> resultMap; in GetCpuInfo()
213 std::string basePath = "/sys/devices/system/cpu/cpufreq/"; in GetCpuInfo()
227 policyFiles.push_back(IncludePathDelimiter(basePath) + std::string(ptr->d_name)); in GetCpuInfo()
230 std::string cpus; in GetCpuInfo()
232 std::string max; in GetCpuInfo()
234 std::string min; in GetCpuInfo()
236 std::string nameBase = "cpu-c" + std::to_string(i + 1) + "-"; in GetCpuInfo()
243 std::map<std::string, std::string> SPUtils::GetGpuInfo() in GetGpuInfo()
245 const std::vector<std::string> gpuCurFreqPaths = { in GetGpuInfo()
249 std::map<std::string, std::string> resultMap; in GetGpuInfo()
252 std::string max; in GetGpuInfo()
254 std::string min; in GetGpuInfo()
262 std::map<std::string, std::string> SPUtils::GetNetwork() in GetNetwork()
265 std::map<std::string, std::string> result; in GetNetwork()