// SPDX-FileCopyrightText: 2018-2023 Giovanni Dante Grazioli // SPDX-License-Identifier: BSD-3-Clause const _known_cpp_data = { 'std::basic_string,std::allocator>,std::allocator,std::allocator>>': 'std::string', 'std::basic_stringstream,std::allocator>::basic_stringstream': 'std::stringstream ', 'std::basic_istringstream,std::allocator>::basic_istringstream': 'std::istringstream ', 'std::basic_ostringstream,std::allocator>::basic_ostringstream': 'std::ostringstream ', 'std::basic_stringstream,std::allocator>::~basic_stringstream': 'std::~stringstream ', 'std::basic_istringstream,std::allocator>::~basic_istringstream': 'std::~istringstream ', 'std::basic_ostringstream,std::allocator>::~basic_ostringstream': 'std::~ostringstream ', 'std::basic_string,std::allocator>::basic_string': 'std::string ', 'std::basic_string,std::allocator>::~basic_string': 'std::~string ', 'std::basic_string,std::allocator>': 'std::string ', 'std::basic_ostream>': 'std::string ', 'std::basic_istream>': 'std::string ', 'operatordelete(void*)': 'delete', ',std::allocator>': ' ', '>': 'std::string ', 'std::_Ios_Openmode': 'std::ios_base::openmode ', '&std::operator>>': '& std::operator >> ', '&std::operator<<': '& std::operator << ', '&std::operator[]': '& std::operator [] ', '&std::operator|': '& std::operator | ', '&std::operator+': '& std::operator + ', '&std::operator+=': '& std::operator += ', 'operator>>': 'operator >> ', 'operator<<': 'operator << ', 'operator[]': 'operator [] ', 'operator|': 'operator | ', 'std::stringconst': 'std::string const', 'unsignedlong': 'unsigned long', 'longlong': 'long long', 'charconst': 'char const', }; export default function(str) { str = str.replace(/::_cxx\d\d::/g, '::').replace(/\s+/g, ''); for (var key in _known_cpp_data) { if (str.indexOf(key) >= 0) { var find = new RegExp(key.replace(/([()[\]|\\*+])/g, '\\$1'), 'g'); str = str.replace(find, _known_cpp_data[key]); } } return str; }