1 /* 2 * Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef SRC_TRACE_BASE_STRINGHELP_H 16 #define SRC_TRACE_BASE_STRINGHELP_H 17 18 #include <cstdint> 19 #include <cxxabi.h> 20 #include <string> 21 #include <vector> 22 #include "securec.h" 23 namespace SysTuning { 24 namespace base { 25 char *GetDemangleSymbolIndex(const char *mangled); 26 std::vector<std::string> SplitStringToVec(const std::string &str, const std::string &pat); 27 bool StartWith(const std::string &str, const std::string &res); 28 bool EndWith(const std::string &str, const std::string &res); 29 std::string FormatString(const char *p); 30 std::string Strip(const std::string &str); 31 std::string TrimInvisibleCharacters(const std::string &str); 32 void RemoveNullTerminator(std::string &str); 33 } // namespace base 34 } // namespace SysTuning 35 #endif // SRC_TRACE_BASE_STRINGHELP_H 36