diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-05-30 19:55:18 -0400 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-05-30 19:55:18 -0400 |
commit | 93dfe8d00dc4ea19b31ebcf4dab35a32cd1d6791 (patch) | |
tree | db4d7ccab16a4ba7c84c5cd0673e9b638b354017 /xsd-frontend/transformations | |
parent | 3c55d0d6934cb037a5fb2b5729b6603d8b7ca7e5 (diff) |
Get rid of dependency on Boost filesystem
Diffstat (limited to 'xsd-frontend/transformations')
-rw-r--r-- | xsd-frontend/transformations/anonymous.cxx | 20 | ||||
-rw-r--r-- | xsd-frontend/transformations/schema-per-type.cxx | 8 |
2 files changed, 17 insertions, 11 deletions
diff --git a/xsd-frontend/transformations/anonymous.cxx b/xsd-frontend/transformations/anonymous.cxx index 3fa4f00..2c5b009 100644 --- a/xsd-frontend/transformations/anonymous.cxx +++ b/xsd-frontend/transformations/anonymous.cxx @@ -531,6 +531,7 @@ namespace XSDFrontend // Run the name through the translation service. // SemanticGraph::Path file (path (l)); + file.normalize (); String file_str; // Try to use the portable representation of the path. If that @@ -538,11 +539,11 @@ namespace XSDFrontend // try { - file_str = file.string (); + file_str = file.posix_string (); } catch (SemanticGraph::InvalidPath const&) { - file_str = file.native_file_string (); + file_str = file.string (); } String name ( @@ -615,17 +616,18 @@ namespace XSDFrontend if (!file_str) { SemanticGraph::Path file (path (u)); + file.normalize (); // Try to use the portable representation of the path. If // that fails, fall back to the native representation. // try { - file_str = file.string (); + file_str = file.posix_string (); } catch (SemanticGraph::InvalidPath const&) { - file_str = file.native_file_string (); + file_str = file.string (); } } @@ -697,6 +699,7 @@ namespace XSDFrontend // Run the name through the translation service. // SemanticGraph::Path file (path (c)); + file.normalize (); String file_str; // Try to use the portable representation of the path. If that @@ -704,11 +707,11 @@ namespace XSDFrontend // try { - file_str = file.string (); + file_str = file.posix_string (); } catch (SemanticGraph::InvalidPath const&) { - file_str = file.native_file_string (); + file_str = file.string (); } String name ( @@ -895,6 +898,7 @@ namespace XSDFrontend // Run the name through the translation service. // SemanticGraph::Path file (path (m)); + file.normalize (); String file_str; // Try to use the portable representation of the path. If that @@ -902,11 +906,11 @@ namespace XSDFrontend // try { - file_str = file.string (); + file_str = file.posix_string (); } catch (SemanticGraph::InvalidPath const&) { - file_str = file.native_file_string (); + file_str = file.string (); } String name ( diff --git a/xsd-frontend/transformations/schema-per-type.cxx b/xsd-frontend/transformations/schema-per-type.cxx index caae52d..b957a58 100644 --- a/xsd-frontend/transformations/schema-per-type.cxx +++ b/xsd-frontend/transformations/schema-per-type.cxx @@ -374,6 +374,8 @@ namespace XSDFrontend for (Schemas::iterator i (schemas.begin ()); i != schemas.end (); ++i) { + // This path was already normalized by the parser. + // SemanticGraph::Path const& path ( (*i)->context ().get<SemanticGraph::Path> ("absolute-path")); @@ -386,15 +388,15 @@ namespace XSDFrontend // try { - abs_path = path.string (); + abs_path = path.posix_string (); } catch (SemanticGraph::InvalidPath const&) { - abs_path = path.native_file_string (); + abs_path = path.string (); } NarrowString tf (trans_.translate_schema (abs_path)); - NarrowString file (tf ? tf : path.leaf ()); + NarrowString file (tf ? tf : path.leaf ().string ()); size_t p (file.rfind ('.')); NarrowString ext ( |