Skip to content

Commit

Permalink
IO_Dxf: syncronize with latest FreeCad + better MTEXT support
Browse files Browse the repository at this point in the history
  • Loading branch information
HuguesDelorme committed Nov 20, 2023
1 parent df7a7e8 commit 0e6b19b
Show file tree
Hide file tree
Showing 5 changed files with 2,363 additions and 1,476 deletions.
15 changes: 15 additions & 0 deletions src/base/string_conv.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#pragma once

#include <NCollection_UtfString.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TCollection_HAsciiString.hxx>
Expand Down Expand Up @@ -136,6 +137,13 @@ template<> struct StringConv<std::string_view, Handle(TCollection_HAsciiString)>
}
};

// std::string_view -> NCollection_Utf8String
template<> struct StringConv<std::string_view, NCollection_Utf8String> {
static auto to(std::string_view str) {
return NCollection_Utf8String(str.data(), static_cast<int>(str.size()));
}
};

// --
// -- Handle(TCollection_HAsciiString) -> X
// --
Expand Down Expand Up @@ -180,6 +188,13 @@ template<> struct StringConv<std::string, TCollection_ExtendedString> {
}
};

// std::string -> NCollection_Utf8String
template<> struct StringConv<std::string, NCollection_Utf8String> {
static auto to(const std::string& str) {
return NCollection_Utf8String(str.c_str(), static_cast<int>(str.size()));
}
};

// --
// -- TCollection_AsciiString -> X
// --
Expand Down
Loading

0 comments on commit 0e6b19b

Please sign in to comment.