30 lines
661 B
C++
30 lines
661 B
C++
#include <NBCore/StringUtils.hpp>
|
|
|
|
/* std::string nb::wstr_to_str(std::wstring in) {
|
|
std::size_t wstrlen = in.length();
|
|
char* c_str= new char[wstrlen];
|
|
std::wcstombs(c_str, in.c_str(), wstrlen);
|
|
std::string ret(c_str, wstrlen);
|
|
delete[] c_str;
|
|
return ret;
|
|
} */
|
|
|
|
std::string nb::indent_strblock(
|
|
std::string block,
|
|
std::string prepend,
|
|
std::string topIndent
|
|
) {
|
|
return topIndent + nb::find_and_replace(
|
|
block,
|
|
nb::NEWLINE,
|
|
nb::NEWLINE + prepend
|
|
);
|
|
}
|
|
|
|
std::string nb::indent_strblock(
|
|
std::string block,
|
|
std::string prepend
|
|
) {
|
|
return nb::indent_strblock(block, prepend, prepend);
|
|
}
|