7#include "MRPch/MRBindingMacros.h"
33#if defined __cpp_lib_char8_t
35[[nodiscard]]
MR_BIND_IGNORE inline std::string
asString(
const std::u8string & s ) {
return { s.begin(), s.end() }; }
36[[nodiscard]]
MR_BIND_IGNORE inline std::u8string
asU8String(
const std::string & s ) {
return { s.begin(), s.end() }; }
38#if defined( _LIBCPP_VERSION ) && _LIBCPP_VERSION < 12000
39[[nodiscard]]
MR_BIND_IGNORE inline std::filesystem::path
pathFromUtf8(
const std::string & s ) {
return std::filesystem::path( s ); }
40[[nodiscard]]
MR_BIND_IGNORE inline std::filesystem::path
pathFromUtf8(
const char * s ) {
return std::filesystem::path( std::string( s ) ); }
60#if defined( _LIBCPP_VERSION ) && _LIBCPP_VERSION < 12000
61[[nodiscard]]
inline std::string
utf8string(
const std::filesystem::path & path )
62 {
return path.u8string(); }
64[[nodiscard]]
inline std::string
utf8string(
const std::filesystem::path & path )
65 {
return asString( path.u8string() ); }
104[[deprecated(
"Use `valueToString()` from `MRViewer/MRUnits.h` instead!")]]
116 return "Loading canceled: " +
utf8string( path );
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:80
MRMESH_API std::string utf8ToSystem(const std::string &utf8)
std::string utf8string(const std::filesystem::path &path)
returns filename as UTF8-encoded string
Definition MRStringConvert.h:64
MRMESH_API std::string systemToUtf8(const std::string &system)
converts system encoded string to UTF8-encoded string
MR_BIND_IGNORE MRMESH_API std::wstring utf8ToWide(const char *utf8)
converts UTF8-encoded string into UTF16-encoded string
MR_BIND_IGNORE const std::string & asU8String(const std::string &s)
Definition MRStringConvert.h:49
MR_BIND_IGNORE MRMESH_API std::string wideToUtf8(const wchar_t *wide)
converts wide null terminating string to UTF8-encoded string
MR_BIND_IGNORE std::filesystem::path pathFromUtf8(const std::string &s)
Definition MRStringConvert.h:54
Definition MRCameraOrientationPlugin.h:8
MRMESH_API MR_BIND_IGNORE char * formatNoTrailingZeros(char *fmt, double v, int digitsAfterPoint, int precision=6)
std::string getCancelMessage(const std::filesystem::path &path)
Definition MRStringConvert.h:114
ImVec2 size(const ViewportRectangle &rect)
Definition MRViewport.h:29
MR_BIND_IGNORE auto unexpected(E &&e)
Definition MRExpected.h:28
MRMESH_API std::string bytesString(size_t size)
MRMESH_API double roundToPrecision(double v, int precision)
returns given value rounded to given number of decimal digits
MRMESH_API bool hasProhibitedChars(const std::string &line)
returns true if line contains any of OS prohibited chars ('?', '*', '/', '\', '"',...
Expected< T > addFileNameInError(Expected< T > v, const std::filesystem::path &file)
if (v) contains an error, then appends given file name to that error
Definition MRStringConvert.h:85
MRMESH_API std::string toLower(std::string str)
return a copy of the string with all alphabetic characters replaced with upper-case variants
tl::expected< T, E > Expected
Definition MRExpected.h:25
MRMESH_API std::string replaceProhibitedChars(const std::string &line, char replacement='_')
replace OS prohibited chars ('?', '*', '/', '\', '"', '<', '>') with replacement char
MRMESH_API std::string commonFilesName(const std::vector< std::filesystem::path > &files)
MRMESH_API const char * asString(ColoringType ct)
returns string representation of enum values
std::array< Vector3f, 3 > MR_BIND_IGNORE
Definition MRMeshBuilderTypes.h:10