MeshLib
 
Loading...
Searching...
No Matches
MRStringConvert.h File Reference
#include "MRMeshFwd.h"
#include <filesystem>
#include <string>
#include "MRExpected.h"

Go to the source code of this file.

Namespaces

namespace  MR
 

Functions

MRMESH_API std::wstring MR::utf8ToWide (const char *utf8)
 converts UTF8-encoded string into UTF16-encoded string
 
MRMESH_API std::string MR::systemToUtf8 (const std::string &system)
 converts system encoded string to UTF8-encoded string
 
MRMESH_API std::string MR::utf8ToSystem (const std::string &utf8)
 
MRMESH_API std::string MR::wideToUtf8 (const wchar_t *wide)
 converts wide null terminating string to UTF8-encoded string
 
const std::string & MR::asString (const std::string &s)
 
const std::string & MR::asU8String (const std::string &s)
 
std::string MR::asString (std::string &&s)
 
std::string MR::asU8String (std::string &&s)
 
std::filesystem::path MR::pathFromUtf8 (const std::string &s)
 
std::filesystem::path MR::pathFromUtf8 (const char *s)
 
std::string MR::utf8string (const std::filesystem::path &path)
 returns filename as UTF8-encoded string
 
MRMESH_API std::string MR::bytesString (size_t size)
 
MRMESH_API bool MR::hasProhibitedChars (const std::string &line)
 returns true if line contains any of OS prohibited chars ('?', '*', '/', '\', '"', '<', '>')
 
MRMESH_API std::string MR::replaceProhibitedChars (const std::string &line, char replacement='_')
 replace OS prohibited chars ('?', '*', '/', '\', '"', '<', '>') with replacement char
 
template<typename T >
Expected< T > MR::addFileNameInError (Expected< T > v, const std::filesystem::path &file)
 if (v) contains an error, then appends given file name to that error
 
MRMESH_API char * MR::formatNoTrailingZeros (char *fmt, double v, int digitsAfterPoint, int precision=6)
 
MRMESH_API double MR::roundToPrecision (double v, int precision)
 returns given value rounded to given number of decimal digits
 
float MR::roundToPrecision (float v, int precision)
 returns given value rounded to given number of decimal digits
 
std::string MR::getCancelMessage (const std::filesystem::path &path)