Lines Matching refs:string
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 is written successfully;
74 bool SaveStringToFile(const std::string& filePath, const std::string& content, bool truncated = true);
78 * @brief Reads a string from a file specified by its file descriptor (FD).
81 * @param content Indicates the <b>std::string</b> object used to hold
83 * @return Returns <b>true</b> if the string is read successfully;
86 bool LoadStringFromFd(int fd, std::string& content);
90 * @brief Writes a string to a file specified by its FD.
93 * @param content Indicates the <b>std::string</b> object to write.
94 * @return Returns <b>true</b> if the string is written successfully;
97 bool SaveStringToFd(int fd, const std::string& content);
109 bool LoadBufferFromFile(const std::string& filePath, std::vector<char>& content);
120 bool SaveBufferToFile(const std::string& filePath, const std::vector<char>& content, bool truncated = true);
130 bool FileExists(const std::string& fileName);
134 * @brief Checks whether a file contains the specified string.
137 * @param subStr Indicates the <b>std::string</b> object to check.
138 * @param caseSensitive Indicates whether the string is case-sensitive.
139 * @return Returns <b>true</b> if the file contains the specified string;
142 bool StringExistsInFile(const std::string& fileName, const std::string& subStr, bool caseSensitive = true);
146 * @brief Obtains the number of occurrences of the specified string in a file.
149 * @param subStr Indicates the <b>std::string</b> object to search.
150 * @param caseSensitive Indicates whether the string is case-sensitive.
151 * @return Returns the number of occurrences of the string in the file;
154 int CountStrInFile(const std::string& fileName, const std::string& subStr, bool caseSensitive = true);