Skip to content

Commit

Permalink
refactor 'to_string' API.
Browse files Browse the repository at this point in the history
fix 'to_string' symbol for value types(e.g. 'vector3f' type) is not exposed.
  • Loading branch information
syoyo committed Jun 3, 2024
1 parent 7368c7b commit 2c43e48
Show file tree
Hide file tree
Showing 4 changed files with 519 additions and 141 deletions.
7 changes: 6 additions & 1 deletion src/pprinter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1883,6 +1883,8 @@ static bool emit_gprim_predefined(std::stringstream &ss, const GPrim *gprim,
}
#endif

// Moved some 'to_string' to value-pprint.cc
#if 0
// TODO: Move to value-pprint.cc

std::string to_string(bool v) {
Expand Down Expand Up @@ -2060,6 +2062,7 @@ std::string to_string(const value::matrix4d &v) {
ss << v;
return ss.str();
}
#endif

std::string to_string(const APISchemas::APIName &name) {
std::string s;
Expand Down Expand Up @@ -2106,6 +2109,7 @@ std::string to_string(const CustomDataType &custom) {
return print_customData(custom, "", 0);
}

#if 0
std::string to_string(const value::StringData &s) {
std::stringstream ss;
ss << s;
Expand All @@ -2118,6 +2122,7 @@ std::string to_string(const std::string &v) {
// Escape backslash
return quote(escapeBackslash(v));
}
#endif

std::string to_string(const Reference &v) {
std::stringstream ss;
Expand Down Expand Up @@ -4382,7 +4387,7 @@ std::string to_string(const XformOp::OpType &op) {
return ss;
}

std::string to_string(const tinyusdz::value::token &v) { return v.str(); }
//std::string to_string(const tinyusdz::value::token &v) { return v.str(); }

std::string to_string(const DomeLight::TextureFormat &texformat) {
std::string s = "[InvalidTextureFormat]";
Expand Down
Loading

0 comments on commit 2c43e48

Please sign in to comment.