/commonlibrary/c_utils/base/include/ |
H A D | string_ex.h | 19 * @brief Provides the global string operation function implemented in c_utils. 28 * string replacement, trim and split etc. 33 #include <string> 40 * @brief Converts all letters in a string to uppercase. 42 * @param str Indicates the base string. 43 * @return Returns a new `std::string` object after conversion. 45 std::string UpperStr(const std::string& str); 49 * @brief Converts all letters in a string to lowercase. 51 * @param str Indicates the base string [all...] |
H A D | directory_ex.h | 19 #include <string> 46 std::string GetCurrentProcFullFileName(); 51 std::string GetCurrentProcPath(); 56 std::string ExtractFilePath(const std::string& fileFullName); 61 std::string ExtractFileName(const std::string& fileFullName); 67 std::string ExtractFileExt(const std::string& fileName); 75 std::string ExcludeTrailingPathDelimite [all...] |
H A D | file_ex.h | 27 * and search for the specified string. 33 #include <string> 53 * @brief Reads a string from a file. 56 * @param content Indicates the <b>std::string</b> object used to hold 58 * @return Returns <b>true</b> if the string is read successfully; 62 bool LoadStringFromFile(const std::string& filePath, std::string& content); 66 * @brief Writes a string to a file. 69 * @param content Indicates the <b>std::string</b> object to write. 71 * @return Returns <b>true</b> if the string i [all...] |
/commonlibrary/ets_utils/js_api_module/uri/ |
H A D | js_uri.h | 22 #include <string>
31 std::string scheme = "";
32 std::string userInfo = "";
33 std::string host = "";
34 std::string query = "";
35 std::string fragment = "";
36 std::string path = "";
37 std::string authority = "";
38 std::string SchemeSpecificPart = "";
46 * @param input Constructs a URI by parsing a given string [all...] |
H A D | js_uri.cpp | 28 std::string digitAggregate = "0123456789";
in PreliminaryWork() 33 std::string alphasAggregate = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
in PreliminaryWork() 38 std::string schemeAggregate = digitAggregate + alphasAggregate + "+-.| _-~!$&=,;'(){}*";
in PreliminaryWork() 43 std::string uricAggregate = schemeAggregate + ";/?:@&=$,[]_!~*'()%\"";
in PreliminaryWork() 48 std::string pathAggregate = schemeAggregate + ";/:@&=$,_!~*'()%";
in PreliminaryWork() 53 std::string userInfoAggregate = schemeAggregate + ";:&=$,_!~*'()%";
in PreliminaryWork() 58 std::string portAggregate = digitAggregate + alphasAggregate + ".:@-;&=+$,-_!~*'()";
in PreliminaryWork() 64 Uri::Uri(const std::string input)
in Uri() 90 if (pos != std::string::npos) {
in AnalysisUri() 97 if (pos != std::string in AnalysisUri() [all...] |
/commonlibrary/c_utils/base/test/unittest/common/ |
H A D | utils_file_test.cpp | 59 bool CreateTestFile(const std::string& path, const std::string& content) in CreateTestFile() 71 int RemoveTestFile(const std::string& path) in RemoveTestFile() 82 string str; in HWTEST_F() 83 string filename = "/proc/meminfo"; in HWTEST_F() 86 string str2; in HWTEST_F() 104 string str; in HWTEST_F() 105 string filename = NULL_STR; in HWTEST_F() 116 string str; in HWTEST_F() 117 string filenam in HWTEST_F() [all...] |
H A D | utils_string_test.cpp | 20 #include <string> 62 string strBase = "strbase"; in HWTEST_F() 63 string strTemp = "STRBASE"; in HWTEST_F() 64 string result = UpperStr(strBase); in HWTEST_F() 74 string strBase = ""; in HWTEST_F() 75 string strTemp = ""; in HWTEST_F() 76 string result = UpperStr(strBase); in HWTEST_F() 90 string strBase = "STRbase"; in HWTEST_F() 91 string strTemp = "strbase"; in HWTEST_F() 92 string resul in HWTEST_F() [all...] |
H A D | utils_directory_test.cpp | 60 string strBaseName = "/data/test/UtilsDirectoryTest"; in HWTEST_F() 61 string strFilename = GetCurrentProcFullFileName(); in HWTEST_F() 71 string strPathName = "/data/test/"; in HWTEST_F() 72 string strCurPathName = GetCurrentProcPath(); in HWTEST_F() 82 string strFilePath = "/data/test/"; in HWTEST_F() 83 string strPath = ExtractFilePath(GetCurrentProcFullFileName()); in HWTEST_F() 93 string strBaseName = "UtilsDirectoryTest"; in HWTEST_F() 94 string strName = ExtractFileName(GetCurrentProcFullFileName()); in HWTEST_F() 104 string strBaseName = "test/test.txt"; in HWTEST_F() 105 string strTypeNam in HWTEST_F() [all...] |
/commonlibrary/ets_utils/js_api_module/xml/ |
H A D | js_xml.h | 22 #include <string> 39 XmlSerializer(char *pStart, size_t bufferLength, const std::string &encoding = "utf-8") :pStart_(pStart), in XmlSerializer() 53 void SetAttributes(const std::string &name, const std::string &value); 60 void AddEmptyElement(std::string name); 72 void StartElement(const std::string &name); 85 void SetNamespace(std::string prefix, const std::string &nsTemp); 92 void SetComment(const std::string &comment); 99 void SetCData(std::string dat [all...] |
/commonlibrary/ets_utils/js_api_module/url/ |
H A D | js_url.h | 25 #include <string>
51 std::vector<std::string> path;
52 std::string password = "";
53 std::string scheme = "";
54 std::string query = "";
55 std::string username = "";
56 std::string fragment = "";
57 std::string host = "";
61 std::string DecodeSpecialChars(std::string inpu [all...] |
H A D | js_url.cpp | 24 std::map<std::string, int> g_head = {
29 std::vector<std::string> g_doubleSegment = {
34 std::vector<std::string> g_singlesegment = { ".", "%2e", "%2E" };
35 std::vector<std::string> g_specialSymbols = {
60 bool CheckCharacter(std::string data, std::bitset<static_cast<size_t>(BitsetStatusFlag::MAX_BIT_SIZE)> rule)
in CheckCharacter() 75 void ReplaceSpecialSymbols(std::string& input, std::string& oldstr, std::string& newstr)
in ReplaceSpecialSymbols() 80 if ((pos = input.find(oldstr)) != std::string::npos) {
in ReplaceSpecialSymbols() 102 std::string DecodeSpecialChar [all...] |
/commonlibrary/c_utils/base/src/ |
H A D | string_ex.cpp | 31 string UpperStr(const string& str) in UpperStr() 33 string upperString = str; in UpperStr() 38 string LowerStr(const string& str) in LowerStr() 40 string lowerString = str; in LowerStr() 45 string ReplaceStr(const string& str, const string& src, const string [all...] |
H A D | directory_ex.cpp | 41 std::string tmpName = std::string(fileFullName); in RustExtractFilePath() 47 std::string tmpName = std::string(fileFullName); in RustExtractFileName() 53 std::string tmpName = std::string(fileName); in RustExtractFileExt() 59 std::string tmpPath = std::string(path); in RustExcludeTrailingPathDelimiter() 65 std::string tmpPath = std::string(pat in RustIncludeTrailingPathDelimiter() [all...] |
H A D | file_ex.cpp | 38 std::string tmpPath(filePath); in RustLoadStringFromFile() 39 std::string tmpContent(content); in RustLoadStringFromFile() 49 std::string tmpContent(content); in RustLoadStringFromFd() 59 std::string tmpPath(filePath); in RustLoadBufferFromFile() 70 std::string tmpPath(filePath); in RustSaveBufferToFile() 77 std::string tmpPath(filePath); in RustSaveStringToFile() 78 std::string tmpContent(content); in RustSaveStringToFile() 84 std::string tmpContent(content); in RustSaveStringToFd() 90 std::string tmpName(fileName); in RustFileExists() 96 std::string tmpNam in RustStringExistsInFile() [all...] |
/commonlibrary/c_utils/base/test/benchmarktest/file_benchmark_test/ |
H A D | file_benchmark_test.cpp | 62 bool CreateTestFile(const std::string& path, const std::string& content) in CreateTestFile() 74 int RemoveTestFile(const std::string& path) in RemoveTestFile() 79 void LoadString(string& filename, string& content, benchmark::State& state) in LoadString() 82 string result; in LoadString() 93 void SaveString(string& filename, string& content, benchmark::State& state) in SaveString() 101 string loadResult; in SaveString() 118 string filenam in BENCHMARK_F() [all...] |
/commonlibrary/ets_utils/js_api_module/convertxml/ |
H A D | js_convertxml.h | 19 #include <string>
35 std::string declaration = "_declaration";
36 std::string instruction = "_instruction";
37 std::string attributes = "_attributes";
38 std::string text = "_text";
39 std::string cdata = "_cdata";
40 std::string doctype = "_doctype";
41 std::string comment = "_comment";
42 std::string parent = "_parent";
43 std::string typ [all...] |
/commonlibrary/c_utils/base/test/benchmarktest/string_benchmark_test/ |
H A D | string_benchmark_test.cpp | 76 string strBase = "strbase"; in BENCHMARK_F() 77 string strTemp = "STRBASE"; in BENCHMARK_F() 78 string result = UpperStr(strBase); in BENCHMARK_F() 92 string strBase = ""; in BENCHMARK_F() 93 string strTemp = ""; in BENCHMARK_F() 94 string result = UpperStr(strBase); in BENCHMARK_F() 112 string strBase = "STRbase"; in BENCHMARK_F() 113 string strTemp = "strbase"; in BENCHMARK_F() 114 string result = LowerStr(strBase); in BENCHMARK_F() 128 string strBas in BENCHMARK_F() [all...] |
/commonlibrary/ets_utils/js_api_module/xml/test/ |
H A D | test_xml.h | 34 static std::string XmlPullParserError(napi_env env); 35 static TagEnum DealExclamationGroup(napi_env env, std::string xml); 37 static TagEnum ParseTagType(napi_env env, std::string str, int apiVersion); 38 static std::string SkipText(napi_env env, std::string strXml, std::string str); 39 static std::string ParseNameInner(napi_env env, size_t start); 40 static std::string ParseName(napi_env env); 41 static bool ParseEntityFunc(napi_env env, std::string out, std::string sysInf [all...] |
/commonlibrary/ets_utils/js_concurrent_module/common/helper/ |
H A D | path_helper.h | 20 #include <string> 41 static bool CheckWorkerPath(napi_env env, std::string script, std::string fileName, bool isRelativePath) in CheckWorkerPath() 43 std::string ohmurl = ""; in CheckWorkerPath() 44 std::string moduleName = ""; in CheckWorkerPath() 45 std::string bundleName = ""; in CheckWorkerPath() 46 if (script.find(PAG_TAG) == 0 || script.find(NAME_SPACE_TAG) != std::string::npos) { in CheckWorkerPath() 61 if (prev != std::string::npos) { in CheckWorkerPath() 64 std::string temp = script.substr(prev + 1); in CheckWorkerPath() 66 if (prev != std::string in CheckWorkerPath() [all...] |
/commonlibrary/ets_utils/js_sys_module/console/ |
H A D | console.h | 19 #include <string> 69 static std::string ParseLogContent(const std::vector<std::string>& params); 70 static std::string MakeLogContent(napi_env env, napi_callback_info info, size_t& argc, 72 static std::string GetTimerOrCounterName(napi_env env, napi_callback_info info, size_t argc); 73 static void PrintTime(std::string timerName, double time, const std::string& log); 75 static std::string RenderHead(napi_env env, napi_value Head, std::vector<size_t> columnWidths); 77 static std::string StringRepeat(size_t number, const std::string [all...] |
/commonlibrary/c_utils/base/test/benchmarktest/directory_benchmark_test/ |
H A D | directory_benchmark_test.cpp | 62 string strBaseName = "/data/test/DirectoryTest"; in BENCHMARK_F() 63 string strFilename = GetCurrentProcFullFileName(); in BENCHMARK_F() 77 string strPathName = "/data/test/"; in BENCHMARK_F() 78 string strCurPathName = GetCurrentProcPath(); in BENCHMARK_F() 92 string strFilePath = "/data/test/"; in BENCHMARK_F() 93 string strPath = ExtractFilePath(GetCurrentProcFullFileName()); in BENCHMARK_F() 107 string strBaseName = "DirectoryTest"; in BENCHMARK_F() 108 string strName = ExtractFileName(GetCurrentProcFullFileName()); in BENCHMARK_F() 122 string strBaseName = "test/test.txt"; in BENCHMARK_F() 123 string strTypeNam in BENCHMARK_F() [all...] |
/commonlibrary/ets_utils/platform/ |
H A D | util_helper.h | 21 #include <string> 48 TextEcodeInfo(napi_env napiEnv, napi_value srcValue, std::string encodingStr): env(napiEnv), in TextEcodeInfo() 54 std::string encoding; 57 OutBufferInfo(size_t length, std::string inputStr, size_t bufferLength, size_t cnt, std::string bufferRst) in OutBufferInfo() 65 std::string rstBuffer; 68 std::string bufferResult; 71 InputBufferInfo(std::string InputEncoding, size_t charSize): encoding(InputEncoding), in InputBufferInfo() 74 std::string encoding; 77 UConverter* CreateConverter(const std::string [all...] |
/commonlibrary/ets_utils/js_api_module/convertxml/test/ |
H A D | test_convertxml.h | 26 static std::string Trim(napi_env env, std::string strXmltrim); 27 static std::string GetNodeType(napi_env env, const xmlElementType enumType); 32 static void SetDefaultKey(napi_env env, size_t i, const std::string strRecv); 33 static void DealSingleLine(napi_env env, std::string &strXml, const napi_value &object); 34 static void DealComplex(napi_env env, std::string &strXml, const napi_value &object); 35 static void Replace(napi_env env, std::string &str, const std::string src, const std::string dst); 40 std::string CxmlTes [all...] |
/commonlibrary/memory_utils/libmeminfo/src/ |
H A D | meminfo.cpp | 42 std::string statm;
in GetRssByPid() 43 std::string vss;
in GetRssByPid() 44 std::string rss;
in GetRssByPid() 46 std::string statmPath = "/proc/" + std::to_string(pid) + "/statm";
in GetRssByPid() 64 std::string filename = "/proc/" + std::to_string(pid) + "/smaps_rollup";
in GetPssByPid() 71 std::string content;
in GetPssByPid() 73 std::string::size_type typePos = content.find(":");
in GetPssByPid() 75 std::string type = content.substr(0, typePos);
in GetPssByPid() 77 std::string valueStr = content.substr(typePos + 1);
in GetPssByPid() 92 std::string filenam in GetSwapPssByPid() [all...] |
/commonlibrary/ets_utils/js_util_module/collections/ |
H A D | native_module_collections.cpp | 16 #include <string> 23 const std::string SENDABLE_ARRAY_NAME = "SendableArray"; 24 const std::string SENDABLE_SET_NAME = "SendableSet"; 25 const std::string SENDABLE_MAP_NAME = "SendableMap"; 26 const std::string SENDABLE_INT8_ARRAY = "SendableInt8Array"; 27 const std::string SENDABLE_UINT8_ARRAY = "SendableUint8Array"; 28 const std::string SENDABLE_INT16_ARRAY = "SendableInt16Array"; 29 const std::string SENDABLE_UINT16_ARRAY = "SendableUint16Array"; 30 const std::string SENDABLE_INT32_ARRAY = "SendableInt32Array"; 31 const std::string SENDABLE_UINT32_ARRA [all...] |