From d51837b9f0b0066a460e472033e682a385052635 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 30 May 2013 19:52:47 -0400 Subject: Get rid of dependency on Boost filesystem --- INSTALL | 3 +- build/import/libboost/LICENSE | 340 ------------------------- build/import/libboost/configuration-rules.make | 15 -- build/import/libboost/configure | 74 ------ build/import/libboost/filesystem/rules.make | 53 ---- build/import/libboost/filesystem/stub.make | 36 --- build/import/libboost/version | 1 - build/import/libxsd-frontend/stub.make | 2 +- xsde/cxx/elements.cxx | 6 +- xsde/cxx/hybrid/aggregate-include.hxx | 5 +- xsde/cxx/hybrid/elements.cxx | 5 +- xsde/cxx/hybrid/generator.cxx | 103 ++++---- xsde/cxx/parser/elements.cxx | 5 +- xsde/cxx/parser/generator.cxx | 78 +++--- xsde/cxx/serializer/elements.cxx | 5 +- xsde/cxx/serializer/generator.cxx | 78 +++--- xsde/makefile | 9 +- xsde/xsde.cxx | 46 ++-- xsde/xsde.hxx | 52 +--- 19 files changed, 167 insertions(+), 749 deletions(-) delete mode 100644 build/import/libboost/LICENSE delete mode 100644 build/import/libboost/configuration-rules.make delete mode 100755 build/import/libboost/configure delete mode 100644 build/import/libboost/filesystem/rules.make delete mode 100644 build/import/libboost/filesystem/stub.make delete mode 100644 build/import/libboost/version diff --git a/INSTALL b/INSTALL index a98c84f..33aabc1 100644 --- a/INSTALL +++ b/INSTALL @@ -10,8 +10,7 @@ Compiler Prerequisites - libxsd-frontend >= 1.18.0 http://www.codesynthesis.com/projects/libxsd-frontend/ - libbackend-elements >= 1.7.2 http://kolpackov.net/projects/libbackend-elements/ - libcult >= 1.4.6 http://kolpackov.net/projects/libcult/ - - libboost_filesystem >= 1.33.1 http://boost.org - - libboost_regex >= 1.33.1 http://boost.org + Generated Code Prerequisites diff --git a/build/import/libboost/LICENSE b/build/import/libboost/LICENSE deleted file mode 100644 index 3912109..0000000 --- a/build/import/libboost/LICENSE +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/build/import/libboost/configuration-rules.make b/build/import/libboost/configuration-rules.make deleted file mode 100644 index df35c70..0000000 --- a/build/import/libboost/configuration-rules.make +++ /dev/null @@ -1,15 +0,0 @@ -# file : build/import/libboost/configuration-rules.make -# author : Boris Kolpackov -# copyright : Copyright (c) 2005-2011 Boris Kolpackov -# license : GNU GPL v2; see accompanying LICENSE file - -$(dcf_root)/import/libboost/configuration-dynamic.make: | $(dcf_root)/import/libboost/. - $(call message,,$(scf_root)/import/libboost/configure $@) - -ifndef %foreign% - -disfigure:: - $(call message,rm $(dcf_root)/import/libboost/configuration-dynamic.make,\ -rm -f $(dcf_root)/import/libboost/configuration-dynamic.make) - -endif diff --git a/build/import/libboost/configure b/build/import/libboost/configure deleted file mode 100755 index 7f78219..0000000 --- a/build/import/libboost/configure +++ /dev/null @@ -1,74 +0,0 @@ -#! /usr/bin/env bash - -# file : build/import/libboost/configure -# author : Boris Kolpackov -# copyright : Copyright (c) 2005-2011 Boris Kolpackov -# license : GNU GPL v2; see accompanying LICENSE file - - -# $1 - out config file -# -# bld_root - build root -# project_name - project name -# - -source $bld_root/dialog.bash - - -$echo -$echo "Configuring external dependency on 'boost libraries' for '$project_name'." -$echo - -$echo -$echo "Would you like to configure dependency on the installed version" -$echo "of 'boost libraries' as opposed to the development build?" -$echo - -installed=`read_y_n y` - -if [ "$installed" = "n" ]; then - - $echo - $echo "Please enter the 'boost' root directory." - $echo - - root=`read_path --directory --exist` - - $echo - $echo "Please select the library type you would like to use:" - $echo - $echo "(1) archive" - $echo "(2) shared object" - $echo - - type=`read_option "archive shared" "shared"` -fi - -$echo -$echo "Link explicitly to the boost system library? This library" -$echo "is available since boost 1.35.0 and linking to it explicitly" -$echo "may be required by newer linkers." -$echo - -link_system=`read_y_n y` - -$echo -$echo "Please enter optional suffix that may be embedded into the" -$echo "boost library names. For example, if your library names are in" -$echo "the libboost_regex-gcc41-mt-d.so form, then enter -gcc41-mt-d" -$echo "Otherwise leave this field blank." -$echo - -suffix= -read -e -p "[]: " suffix - -echo libboost_installed := $installed >$1 -echo libboost_suffix := $suffix >>$1 -echo libboost_system := $link_system >>$1 - -if [ "$installed" = "n" ]; then - - echo libboost_root := $root >>$1 - echo libboost_type := $type >>$1 - -fi diff --git a/build/import/libboost/filesystem/rules.make b/build/import/libboost/filesystem/rules.make deleted file mode 100644 index fa70735..0000000 --- a/build/import/libboost/filesystem/rules.make +++ /dev/null @@ -1,53 +0,0 @@ -# file : build/import/libboost/filesystem/rules.make -# author : Boris Kolpackov -# copyright : Copyright (c) 2005-2011 Boris Kolpackov -# license : GNU GPL v2; see accompanying LICENSE file - -#@@ Should use message everywhere. -# - -$(dcf_root)/import/libboost/%: root := $(libboost_root) - -$(dcf_root)/import/libboost/filesystem/filesystem.l: \ - | $(dcf_root)/import/libboost/filesystem/. - -ifeq ($(libboost_type),archive) - -ifeq ($(libboost_system),y) -$(dcf_root)/import/libboost/filesystem/filesystem.l: \ - $(libboost_root)/stage/lib/libboost_filesystem$(libboost_suffix).a \ - $(libboost_root)/stage/lib/libboost_system$(libboost_suffix).a -else -$(dcf_root)/import/libboost/filesystem/filesystem.l: \ - $(libboost_root)/stage/lib/libboost_filesystem$(libboost_suffix).a -endif - @echo $^ >$@ - -else - -ifeq ($(libboost_system),y) -$(dcf_root)/import/libboost/filesystem/filesystem.l: \ - $(libboost_root)/stage/lib/libboost_filesystem$(libboost_suffix).so \ - $(libboost_root)/stage/lib/libboost_system$(libboost_suffix).so -else -$(dcf_root)/import/libboost/filesystem/filesystem.l: \ - $(libboost_root)/stage/lib/libboost_filesystem$(libboost_suffix).so -endif - @echo $^ >$@ - @echo rpath:$(root)/stage/lib >>$@ - -endif - - -$(dcf_root)/import/libboost/filesystem/filesystem.l.cpp-options: \ - | $(dcf_root)/import/libboost/filesystem/. - @echo include: -I$(root) >$@ - -ifndef %foreign% - -disfigure:: - $(call message,rm $(dcf_root)/import/libboost/filesystem/filesystem.l,\ -rm -f $(dcf_root)/import/libboost/filesystem/filesystem.l) - $(call message,,rm -f $(dcf_root)/import/libboost/filesystem/filesystem.l.cpp-options) - -endif diff --git a/build/import/libboost/filesystem/stub.make b/build/import/libboost/filesystem/stub.make deleted file mode 100644 index 76ad55e..0000000 --- a/build/import/libboost/filesystem/stub.make +++ /dev/null @@ -1,36 +0,0 @@ -# file : build/import/libboost/filesystem/stub.make -# author : Boris Kolpackov -# copyright : Copyright (c) 2005-2011 Boris Kolpackov -# license : GNU GPL v2; see accompanying LICENSE file - -$(call include-once,$(scf_root)/import/libboost/configuration-rules.make,$(dcf_root)) - -libboost_installed := - -$(call -include,$(dcf_root)/import/libboost/configuration-dynamic.make) - -ifdef libboost_installed - -ifeq ($(libboost_installed),y) - -ifeq ($(libboost_system),y) -$(call export,l: -lboost_filesystem$(libboost_suffix) -lboost_system$(libboost_suffix),cpp_options: ) -else -$(call export,l: -lboost_filesystem$(libboost_suffix),cpp_options: ) -endif - -else - -$(call include-once,$(scf_root)/import/libboost/filesystem/rules.make,$(dcf_root)) - -$(call export,\ - l: $(dcf_root)/import/libboost/filesystem/filesystem.l,\ - cpp-options: $(dcf_root)/import/libboost/filesystem/filesystem.l.cpp-options) - -endif - -else - -.NOTPARALLEL: - -endif diff --git a/build/import/libboost/version b/build/import/libboost/version deleted file mode 100644 index faef31a..0000000 --- a/build/import/libboost/version +++ /dev/null @@ -1 +0,0 @@ -0.7.0 diff --git a/build/import/libxsd-frontend/stub.make b/build/import/libxsd-frontend/stub.make index f861eb6..8c72f1b 100644 --- a/build/import/libxsd-frontend/stub.make +++ b/build/import/libxsd-frontend/stub.make @@ -13,7 +13,7 @@ ifdef libxsd_frontend_installed ifeq ($(libxsd_frontend_installed),y) -$(call export,l: -lxsd-frontend -lfrontend-elements -lcult -lboost_filesystem -lxerces-c,cpp_options: ) +$(call export,l: -lxsd-frontend -lfrontend-elements -lcult -lxerces-c,cpp_options: ) else diff --git a/xsde/cxx/elements.cxx b/xsde/cxx/elements.cxx index 07917e6..f1a7760 100644 --- a/xsde/cxx/elements.cxx +++ b/xsde/cxx/elements.cxx @@ -291,16 +291,18 @@ namespace CXX if (!path.empty ()) { + path.normalize (); + // Try to use the portable representation of the path. If that // fails, fall back to the native representation. // try { - pair = path.string (); + pair = path.posix_string (); } catch (SemanticGraph::InvalidPath const&) { - pair = path.native_file_string (); + pair = path.string (); } } diff --git a/xsde/cxx/hybrid/aggregate-include.hxx b/xsde/cxx/hybrid/aggregate-include.hxx index 01ec3c9..fad7638 100644 --- a/xsde/cxx/hybrid/aggregate-include.hxx +++ b/xsde/cxx/hybrid/aggregate-include.hxx @@ -152,6 +152,7 @@ namespace CXX schemas_.insert (s); SemanticGraph::Path path (s->used_begin ()->path ()); + path.normalize (); // Try to use the portable representation of the path. If that // fails, fall back to the native representation. @@ -159,11 +160,11 @@ namespace CXX NarrowString path_str; try { - path_str = path.string (); + path_str = path.posix_string (); } catch (SemanticGraph::InvalidPath const&) { - path_str = path.native_file_string (); + path_str = path.string (); } String inc_path (hxx_expr->replace (path_str)); diff --git a/xsde/cxx/hybrid/elements.cxx b/xsde/cxx/hybrid/elements.cxx index fe1e533..0f49311 100644 --- a/xsde/cxx/hybrid/elements.cxx +++ b/xsde/cxx/hybrid/elements.cxx @@ -592,6 +592,7 @@ namespace CXX s.context ().count ("renamed") ? s.context ().get ("renamed") : u.path ()); + path.normalize (); // Try to use the portable representation of the path. If that // fails, fall back to the native representation. @@ -599,11 +600,11 @@ namespace CXX NarrowString path_str; try { - path_str = path.string (); + path_str = path.posix_string (); } catch (SemanticGraph::InvalidPath const&) { - path_str = path.native_file_string (); + path_str = path.string (); } String inc_path; diff --git a/xsde/cxx/hybrid/generator.cxx b/xsde/cxx/hybrid/generator.cxx index eac7cf0..e2e0f71 100644 --- a/xsde/cxx/hybrid/generator.cxx +++ b/xsde/cxx/hybrid/generator.cxx @@ -3,10 +3,10 @@ // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file -#include +#include #include - -#include +#include +#include #include @@ -56,17 +56,9 @@ using namespace XSDFrontend::SemanticGraph; // // -typedef -boost::filesystem::wifstream -WideInputFileStream; - -typedef -boost::filesystem::wofstream -WideOutputFileStream; - -typedef -boost::filesystem::ifstream -NarrowInputFileStream; +typedef std::wifstream WideInputFileStream; +typedef std::wofstream WideOutputFileStream; +typedef std::ifstream NarrowInputFileStream; namespace CXX { @@ -434,8 +426,9 @@ namespace CXX { try { - Path fs_path (path, boost::filesystem::native); - ifs.open (fs_path, std::ios_base::in | std::ios_base::binary); + Path fs_path (path); + ifs.open (fs_path.string ().c_str (), + std::ios_base::in | std::ios_base::binary); if (!ifs.is_open ()) { @@ -569,7 +562,7 @@ namespace CXX { if (NarrowString name = ops.extern_xml_schema ()) { - if (file_path.native_file_string () != name) + if (file_path.string () != name) generate_xml_schema = false; } } @@ -595,7 +588,7 @@ namespace CXX bool forward (ops.generate_forward () && !generate_xml_schema); bool source (!generate_xml_schema); - NarrowString name (file_path.leaf ()); + NarrowString name (file_path.leaf ().string ()); NarrowString hxx_suffix (ops.hxx_suffix ()); NarrowString ixx_suffix (ops.ixx_suffix ()); @@ -663,10 +656,10 @@ namespace CXX NarrowString cxx_name (source ? cxx_expr.replace (name) : NarrowString ()); NarrowString fwd_name (forward ? fwd_expr.replace (name) : NarrowString ()); - Path hxx_path (hxx_name, boost::filesystem::native); - Path ixx_path (ixx_name, boost::filesystem::native); - Path cxx_path (cxx_name, boost::filesystem::native); - Path fwd_path (fwd_name, boost::filesystem::native); + Path hxx_path (hxx_name); + Path ixx_path (ixx_name); + Path cxx_path (cxx_name); + Path fwd_path (fwd_name); Path out_dir; @@ -674,7 +667,7 @@ namespace CXX { try { - out_dir = Path (dir, boost::filesystem::native); + out_dir = Path (dir); } catch (InvalidPath const&) { @@ -689,7 +682,7 @@ namespace CXX // unless the user added the directory so that we propagate this // to the output files. // - Path fpt_dir (file_path.branch_path ()); + Path fpt_dir (file_path.directory ()); if (!fpt_dir.empty ()) out_dir /= fpt_dir; @@ -705,7 +698,7 @@ namespace CXX // Open the tree files. // - WideOutputFileStream hxx (hxx_path, ios_base::out); + WideOutputFileStream hxx (hxx_path.string ().c_str (), ios_base::out); WideOutputFileStream ixx; WideOutputFileStream cxx; WideOutputFileStream fwd; @@ -714,7 +707,7 @@ namespace CXX // if (forward) { - fwd.open (fwd_path, ios_base::out); + fwd.open (fwd_path.string ().c_str (), ios_base::out); if (!fwd.is_open ()) { @@ -723,7 +716,7 @@ namespace CXX } unlinks.add (fwd_path); - file_list.push_back (fwd_path.native_file_string ()); + file_list.push_back (fwd_path.string ()); } if (!hxx.is_open ()) @@ -733,11 +726,11 @@ namespace CXX } unlinks.add (hxx_path); - file_list.push_back (hxx_path.native_file_string ()); + file_list.push_back (hxx_path.string ()); if (inline_) { - ixx.open (ixx_path, ios_base::out); + ixx.open (ixx_path.string ().c_str (), ios_base::out); if (!ixx.is_open ()) { @@ -746,12 +739,12 @@ namespace CXX } unlinks.add (ixx_path); - file_list.push_back (ixx_path.native_file_string ()); + file_list.push_back (ixx_path.string ()); } if (source) { - cxx.open (cxx_path, ios_base::out); + cxx.open (cxx_path.string ().c_str (), ios_base::out); if (!cxx.is_open ()) { @@ -760,7 +753,7 @@ namespace CXX } unlinks.add (cxx_path); - file_list.push_back (cxx_path.native_file_string ()); + file_list.push_back (cxx_path.string ()); } // Print copyright and license. @@ -811,7 +804,7 @@ namespace CXX NarrowString guard_prefix (ops.guard_prefix ()); if (!guard_prefix) - guard_prefix = file_path.branch_path ().native_directory_string (); + guard_prefix = file_path.directory ().string (); if (guard_prefix) guard_prefix += '_'; @@ -1310,7 +1303,7 @@ namespace CXX { if (NarrowString name = ops.extern_xml_schema ()) { - if (file_path.native_file_string () != name) + if (file_path.string () != name) gen_xml_schema = false; } } @@ -1328,7 +1321,7 @@ namespace CXX throw Failed (); } - NarrowString name (file_path.leaf ()); + NarrowString name (file_path.leaf ().string ()); NarrowString skel_suffix (ops.pskel_file_suffix ()); NarrowString impl_suffix (ops.pimpl_file_suffix ()); @@ -1387,8 +1380,8 @@ namespace CXX NarrowString hxx_name (hxx_expr.replace (name)); NarrowString cxx_name (cxx_expr.replace (name)); - Path hxx_path (hxx_name, boost::filesystem::native); - Path cxx_path (cxx_name, boost::filesystem::native); + Path hxx_path (hxx_name); + Path cxx_path (cxx_name); Path out_dir; @@ -1396,7 +1389,7 @@ namespace CXX { try { - out_dir = Path (dir, boost::filesystem::native); + out_dir = Path (dir); } catch (InvalidPath const&) { @@ -1411,7 +1404,7 @@ namespace CXX // unless the user added the directory so that we propagate this // to the output files. // - Path fpt_dir (file_path.branch_path ()); + Path fpt_dir (file_path.directory ()); if (!fpt_dir.empty ()) out_dir /= fpt_dir; @@ -1423,8 +1416,8 @@ namespace CXX cxx_path = out_dir / cxx_path; } - WideOutputFileStream hxx (hxx_path, ios_base::out); - WideOutputFileStream cxx (cxx_path, ios_base::out); + WideOutputFileStream hxx (hxx_path.string ().c_str (), ios_base::out); + WideOutputFileStream cxx (cxx_path.string ().c_str (), ios_base::out); if (!hxx.is_open ()) { @@ -1433,7 +1426,7 @@ namespace CXX } unlinks.add (hxx_path); - file_list.push_back (hxx_path.native_file_string ()); + file_list.push_back (hxx_path.string ()); if (!cxx.is_open ()) { @@ -1442,7 +1435,7 @@ namespace CXX } unlinks.add (cxx_path); - file_list.push_back (cxx_path.native_file_string ()); + file_list.push_back (cxx_path.string ()); // Print copyright and license. // @@ -1484,7 +1477,7 @@ namespace CXX NarrowString guard_prefix (ops.guard_prefix ()); if (!guard_prefix) - guard_prefix = file_path.branch_path ().native_directory_string (); + guard_prefix = file_path.directory ().string (); if (guard_prefix) guard_prefix += '_'; @@ -1696,7 +1689,7 @@ namespace CXX { if (NarrowString name = ops.extern_xml_schema ()) { - if (file_path.native_file_string () != name) + if (file_path.string () != name) gen_xml_schema = false; } } @@ -1714,7 +1707,7 @@ namespace CXX throw Failed (); } - NarrowString name (file_path.leaf ()); + NarrowString name (file_path.leaf ().string ()); NarrowString skel_suffix (ops.sskel_file_suffix ()); NarrowString impl_suffix (ops.simpl_file_suffix ()); @@ -1773,8 +1766,8 @@ namespace CXX NarrowString hxx_name (hxx_expr.replace (name)); NarrowString cxx_name (cxx_expr.replace (name)); - Path hxx_path (hxx_name, boost::filesystem::native); - Path cxx_path (cxx_name, boost::filesystem::native); + Path hxx_path (hxx_name); + Path cxx_path (cxx_name); Path out_dir; @@ -1782,7 +1775,7 @@ namespace CXX { try { - out_dir = Path (dir, boost::filesystem::native); + out_dir = Path (dir); } catch (InvalidPath const&) { @@ -1797,7 +1790,7 @@ namespace CXX // unless the user added the directory so that we propagate this // to the output files. // - Path fpt_dir (file_path.branch_path ()); + Path fpt_dir (file_path.directory ()); if (!fpt_dir.empty ()) out_dir /= fpt_dir; @@ -1809,8 +1802,8 @@ namespace CXX cxx_path = out_dir / cxx_path; } - WideOutputFileStream hxx (hxx_path, ios_base::out); - WideOutputFileStream cxx (cxx_path, ios_base::out); + WideOutputFileStream hxx (hxx_path.string ().c_str (), ios_base::out); + WideOutputFileStream cxx (cxx_path.string ().c_str (), ios_base::out); if (!hxx.is_open ()) { @@ -1819,7 +1812,7 @@ namespace CXX } unlinks.add (hxx_path); - file_list.push_back (hxx_path.native_file_string ()); + file_list.push_back (hxx_path.string ()); if (!cxx.is_open ()) { @@ -1828,7 +1821,7 @@ namespace CXX } unlinks.add (cxx_path); - file_list.push_back (cxx_path.native_file_string ()); + file_list.push_back (cxx_path.string ()); // Print copyright and license. // @@ -1870,7 +1863,7 @@ namespace CXX NarrowString guard_prefix (ops.guard_prefix ()); if (!guard_prefix) - guard_prefix = file_path.branch_path ().native_directory_string (); + guard_prefix = file_path.directory ().string (); if (guard_prefix) guard_prefix += '_'; diff --git a/xsde/cxx/parser/elements.cxx b/xsde/cxx/parser/elements.cxx index 46518fa..05bcae0 100644 --- a/xsde/cxx/parser/elements.cxx +++ b/xsde/cxx/parser/elements.cxx @@ -267,6 +267,7 @@ namespace CXX s.context ().count ("renamed") ? s.context ().get ("renamed") : u.path ()); + path.normalize (); // Try to use the portable representation of the path. If that // fails, fall back to the native representation. @@ -274,11 +275,11 @@ namespace CXX NarrowString path_str; try { - path_str = path.string (); + path_str = path.posix_string (); } catch (SemanticGraph::InvalidPath const&) { - path_str = path.native_file_string (); + path_str = path.string (); } String inc_path; diff --git a/xsde/cxx/parser/generator.cxx b/xsde/cxx/parser/generator.cxx index f78291e..45873ef 100644 --- a/xsde/cxx/parser/generator.cxx +++ b/xsde/cxx/parser/generator.cxx @@ -3,9 +3,9 @@ // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include #include - -#include +#include #include @@ -51,17 +51,9 @@ using namespace XSDFrontend::SemanticGraph; // // -typedef -boost::filesystem::wifstream -WideInputFileStream; - -typedef -boost::filesystem::wofstream -WideOutputFileStream; - -typedef -boost::filesystem::ifstream -NarrowInputFileStream; +typedef std::wifstream WideInputFileStream; +typedef std::wofstream WideOutputFileStream; +typedef std::ifstream NarrowInputFileStream; namespace CXX { @@ -131,8 +123,9 @@ namespace CXX { try { - Path fs_path (path, boost::filesystem::native); - ifs.open (fs_path, std::ios_base::in | std::ios_base::binary); + Path fs_path (path); + ifs.open (fs_path.string ().c_str (), + std::ios_base::in | std::ios_base::binary); if (!ifs.is_open ()) { @@ -215,7 +208,7 @@ namespace CXX { if (NarrowString name = ops.extern_xml_schema ()) { - if (file_path.native_file_string () != name) + if (file_path.string () != name) generate_xml_schema = false; } } @@ -409,7 +402,7 @@ namespace CXX bool inline_ (ops.generate_inline () && !generate_xml_schema); bool source (!generate_xml_schema); - NarrowString name (file_path.leaf ()); + NarrowString name (file_path.leaf ().string ()); NarrowString skel_suffix (ops.skel_file_suffix ()); NarrowString impl_suffix (ops.impl_file_suffix ()); @@ -514,9 +507,9 @@ namespace CXX cxx_driver_name = cxx_driver_expr.replace (name); } - Path hxx_path (hxx_name, boost::filesystem::native); - Path ixx_path (ixx_name, boost::filesystem::native); - Path cxx_path (cxx_name, boost::filesystem::native); + Path hxx_path (hxx_name); + Path ixx_path (ixx_name); + Path cxx_path (cxx_name); Path hxx_impl_path; Path cxx_impl_path; @@ -524,9 +517,9 @@ namespace CXX if (impl || driver) { - hxx_impl_path = Path (hxx_impl_name, boost::filesystem::native); - cxx_impl_path = Path (cxx_impl_name, boost::filesystem::native); - cxx_driver_path = Path (cxx_driver_name, boost::filesystem::native); + hxx_impl_path = Path (hxx_impl_name); + cxx_impl_path = Path (cxx_impl_name); + cxx_driver_path = Path (cxx_driver_name); } Path out_dir; @@ -535,7 +528,7 @@ namespace CXX { try { - out_dir = Path (dir, boost::filesystem::native); + out_dir = Path (dir); } catch (InvalidPath const&) { @@ -550,7 +543,7 @@ namespace CXX // unless the user added the directory so that we propagate this // to the output files. // - Path fpt_dir (file_path.branch_path ()); + Path fpt_dir (file_path.directory ()); if (!fpt_dir.empty ()) out_dir /= fpt_dir; @@ -581,7 +574,8 @@ namespace CXX { if (!ops.force_overwrite ()) { - WideInputFileStream tmp (hxx_impl_path, ios_base::in); + WideInputFileStream tmp ( + hxx_impl_path.string ().c_str (), ios_base::in); if (tmp.is_open ()) { @@ -593,7 +587,7 @@ namespace CXX tmp.close (); } - hxx_impl.open (hxx_impl_path, ios_base::out); + hxx_impl.open (hxx_impl_path.string ().c_str (), ios_base::out); if (!hxx_impl.is_open ()) { @@ -603,11 +597,12 @@ namespace CXX } unlinks.add (hxx_impl_path); - file_list.push_back (hxx_impl_path.native_file_string ()); + file_list.push_back (hxx_impl_path.string ()); if (!ops.force_overwrite ()) { - WideInputFileStream tmp (cxx_impl_path, ios_base::in); + WideInputFileStream tmp ( + cxx_impl_path.string ().c_str (), ios_base::in); if (tmp.is_open ()) { @@ -619,7 +614,7 @@ namespace CXX tmp.close (); } - cxx_impl.open (cxx_impl_path, ios_base::out); + cxx_impl.open (cxx_impl_path.string ().c_str (), ios_base::out); if (!cxx_impl.is_open ()) { @@ -629,14 +624,15 @@ namespace CXX } unlinks.add (cxx_impl_path); - file_list.push_back (cxx_impl_path.native_file_string ()); + file_list.push_back (cxx_impl_path.string ()); } if (driver) { if (!ops.force_overwrite ()) { - WideInputFileStream tmp (cxx_driver_path, ios_base::in); + WideInputFileStream tmp ( + cxx_driver_path.string ().c_str (), ios_base::in); if (tmp.is_open ()) { @@ -648,7 +644,7 @@ namespace CXX tmp.close (); } - cxx_driver.open (cxx_driver_path, ios_base::out); + cxx_driver.open (cxx_driver_path.string ().c_str (), ios_base::out); if (!cxx_driver.is_open ()) { @@ -658,12 +654,12 @@ namespace CXX } unlinks.add (cxx_driver_path); - file_list.push_back (cxx_driver_path.native_file_string ()); + file_list.push_back (cxx_driver_path.string ()); } // Open the skel files. // - WideOutputFileStream hxx (hxx_path, ios_base::out); + WideOutputFileStream hxx (hxx_path.string ().c_str (), ios_base::out); WideOutputFileStream ixx; WideOutputFileStream cxx; @@ -674,11 +670,11 @@ namespace CXX } unlinks.add (hxx_path); - file_list.push_back (hxx_path.native_file_string ()); + file_list.push_back (hxx_path.string ()); if (inline_) { - ixx.open (ixx_path, ios_base::out); + ixx.open (ixx_path.string ().c_str (), ios_base::out); if (!ixx.is_open ()) { @@ -687,12 +683,12 @@ namespace CXX } unlinks.add (ixx_path); - file_list.push_back (ixx_path.native_file_string ()); + file_list.push_back (ixx_path.string ()); } if (source) { - cxx.open (cxx_path, ios_base::out); + cxx.open (cxx_path.string ().c_str (), ios_base::out); if (!cxx.is_open ()) { @@ -701,7 +697,7 @@ namespace CXX } unlinks.add (cxx_path); - file_list.push_back (cxx_path.native_file_string ()); + file_list.push_back (cxx_path.string ()); } // Print copyright and license. @@ -766,7 +762,7 @@ namespace CXX NarrowString guard_prefix (ops.guard_prefix ()); if (!guard_prefix) - guard_prefix = file_path.branch_path ().native_directory_string (); + guard_prefix = file_path.directory ().string (); if (guard_prefix) guard_prefix += '_'; diff --git a/xsde/cxx/serializer/elements.cxx b/xsde/cxx/serializer/elements.cxx index 061a1ae..f021c54 100644 --- a/xsde/cxx/serializer/elements.cxx +++ b/xsde/cxx/serializer/elements.cxx @@ -290,6 +290,7 @@ namespace CXX s.context ().count ("renamed") ? s.context ().get ("renamed") : u.path ()); + path.normalize (); // Try to use the portable representation of the path. If that // fails, fall back to the native representation. @@ -297,11 +298,11 @@ namespace CXX NarrowString path_str; try { - path_str = path.string (); + path_str = path.posix_string (); } catch (SemanticGraph::InvalidPath const&) { - path_str = path.native_file_string (); + path_str = path.string (); } String inc_path; diff --git a/xsde/cxx/serializer/generator.cxx b/xsde/cxx/serializer/generator.cxx index 1b1a468..94dcaec 100644 --- a/xsde/cxx/serializer/generator.cxx +++ b/xsde/cxx/serializer/generator.cxx @@ -3,9 +3,9 @@ // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file +#include #include - -#include +#include #include @@ -49,17 +49,9 @@ using namespace XSDFrontend::SemanticGraph; // // -typedef -boost::filesystem::wifstream -WideInputFileStream; - -typedef -boost::filesystem::wofstream -WideOutputFileStream; - -typedef -boost::filesystem::ifstream -NarrowInputFileStream; +typedef std::wifstream WideInputFileStream; +typedef std::wofstream WideOutputFileStream; +typedef std::ifstream NarrowInputFileStream; namespace CXX { @@ -129,8 +121,9 @@ namespace CXX { try { - Path fs_path (path, boost::filesystem::native); - ifs.open (fs_path, std::ios_base::in | std::ios_base::binary); + Path fs_path (path); + ifs.open (fs_path.string ().c_str (), + std::ios_base::in | std::ios_base::binary); if (!ifs.is_open ()) { @@ -213,7 +206,7 @@ namespace CXX { if (NarrowString name = ops.extern_xml_schema ()) { - if (file_path.native_file_string () != name) + if (file_path.string () != name) generate_xml_schema = false; } } @@ -397,7 +390,7 @@ namespace CXX bool inline_ (ops.generate_inline () && !generate_xml_schema); bool source (!generate_xml_schema); - NarrowString name (file_path.leaf ()); + NarrowString name (file_path.leaf ().string ()); NarrowString skel_suffix (ops.skel_file_suffix ()); NarrowString impl_suffix (ops.impl_file_suffix ()); @@ -503,9 +496,9 @@ namespace CXX cxx_driver_name = cxx_driver_expr.replace (name); } - Path hxx_path (hxx_name, boost::filesystem::native); - Path ixx_path (ixx_name, boost::filesystem::native); - Path cxx_path (cxx_name, boost::filesystem::native); + Path hxx_path (hxx_name); + Path ixx_path (ixx_name); + Path cxx_path (cxx_name); Path hxx_impl_path; Path cxx_impl_path; @@ -513,9 +506,9 @@ namespace CXX if (impl || driver) { - hxx_impl_path = Path (hxx_impl_name, boost::filesystem::native); - cxx_impl_path = Path (cxx_impl_name, boost::filesystem::native); - cxx_driver_path = Path (cxx_driver_name, boost::filesystem::native); + hxx_impl_path = Path (hxx_impl_name); + cxx_impl_path = Path (cxx_impl_name); + cxx_driver_path = Path (cxx_driver_name); } Path out_dir; @@ -524,7 +517,7 @@ namespace CXX { try { - out_dir = Path (dir, boost::filesystem::native); + out_dir = Path (dir); } catch (InvalidPath const&) { @@ -539,7 +532,7 @@ namespace CXX // unless the user added the directory so that we propagate this // to the output files. // - Path fpt_dir (file_path.branch_path ()); + Path fpt_dir (file_path.directory ()); if (!fpt_dir.empty ()) out_dir /= fpt_dir; @@ -570,7 +563,8 @@ namespace CXX { if (!ops.force_overwrite ()) { - WideInputFileStream tmp (hxx_impl_path, ios_base::in); + WideInputFileStream tmp ( + hxx_impl_path.string ().c_str (), ios_base::in); if (tmp.is_open ()) { @@ -582,7 +576,7 @@ namespace CXX tmp.close (); } - hxx_impl.open (hxx_impl_path, ios_base::out); + hxx_impl.open (hxx_impl_path.string ().c_str (), ios_base::out); if (!hxx_impl.is_open ()) { @@ -592,11 +586,12 @@ namespace CXX } unlinks.add (hxx_impl_path); - file_list.push_back (hxx_impl_path.native_file_string ()); + file_list.push_back (hxx_impl_path.string ()); if (!ops.force_overwrite ()) { - WideInputFileStream tmp (cxx_impl_path, ios_base::in); + WideInputFileStream tmp ( + cxx_impl_path.string ().c_str (), ios_base::in); if (tmp.is_open ()) { @@ -608,7 +603,7 @@ namespace CXX tmp.close (); } - cxx_impl.open (cxx_impl_path, ios_base::out); + cxx_impl.open (cxx_impl_path.string ().c_str (), ios_base::out); if (!cxx_impl.is_open ()) { @@ -618,14 +613,15 @@ namespace CXX } unlinks.add (cxx_impl_path); - file_list.push_back (cxx_impl_path.native_file_string ()); + file_list.push_back (cxx_impl_path.string ()); } if (driver) { if (!ops.force_overwrite ()) { - WideInputFileStream tmp (cxx_driver_path, ios_base::in); + WideInputFileStream tmp ( + cxx_driver_path.string ().c_str (), ios_base::in); if (tmp.is_open ()) { @@ -637,7 +633,7 @@ namespace CXX tmp.close (); } - cxx_driver.open (cxx_driver_path, ios_base::out); + cxx_driver.open (cxx_driver_path.string ().c_str (), ios_base::out); if (!cxx_driver.is_open ()) { @@ -647,12 +643,12 @@ namespace CXX } unlinks.add (cxx_driver_path); - file_list.push_back (cxx_driver_path.native_file_string ()); + file_list.push_back (cxx_driver_path.string ()); } // Open the skel files. // - WideOutputFileStream hxx (hxx_path, ios_base::out); + WideOutputFileStream hxx (hxx_path.string ().c_str (), ios_base::out); WideOutputFileStream ixx; WideOutputFileStream cxx; @@ -663,11 +659,11 @@ namespace CXX } unlinks.add (hxx_path); - file_list.push_back (hxx_path.native_file_string ()); + file_list.push_back (hxx_path.string ()); if (inline_) { - ixx.open (ixx_path, ios_base::out); + ixx.open (ixx_path.string ().c_str (), ios_base::out); if (!ixx.is_open ()) { @@ -676,12 +672,12 @@ namespace CXX } unlinks.add (ixx_path); - file_list.push_back (ixx_path.native_file_string ()); + file_list.push_back (ixx_path.string ()); } if (source) { - cxx.open (cxx_path, ios_base::out); + cxx.open (cxx_path.string ().c_str (), ios_base::out); if (!cxx.is_open ()) { @@ -690,7 +686,7 @@ namespace CXX } unlinks.add (cxx_path); - file_list.push_back (cxx_path.native_file_string ()); + file_list.push_back (cxx_path.string ()); } // Print copyright and license. @@ -755,7 +751,7 @@ namespace CXX NarrowString guard_prefix (ops.guard_prefix ()); if (!guard_prefix) - guard_prefix = file_path.branch_path ().native_directory_string (); + guard_prefix = file_path.directory ().string (); if (guard_prefix) guard_prefix += '_'; diff --git a/xsde/makefile b/xsde/makefile index 358ddfd..d93fcd3 100644 --- a/xsde/makefile +++ b/xsde/makefile @@ -114,22 +114,17 @@ $(call import,\ l: cutl.l,cpp-options: cutl.l.cpp-options) $(call import,\ - $(scf_root)/import/libboost/filesystem/stub.make,\ - l: fs.l,cpp-options: fs.l.cpp-options) - -$(call import,\ $(scf_root)/import/libxsd-frontend/stub.make,\ l: xsd_fe.l,cpp-options: xsd_fe.l.cpp-options) # Build. # -$(xsde): $(cxx_obj) $(xsd_fe.l) $(cutl.l) $(fs.l) +$(xsde): $(cxx_obj) $(xsd_fe.l) $(cutl.l) $(cxx_obj) $(cxx_od): cpp_options := -I$(src_base) $(cxx_obj) $(cxx_od): \ $(xsd_fe.l.cpp-options) \ - $(cutl.l.cpp-options) \ - $(fs.l.cpp-options) + $(cutl.l.cpp-options) genf := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx) $(cli_tun:.cli=.cxx) gen := $(addprefix $(out_base)/,$(genf)) diff --git a/xsde/xsde.cxx b/xsde/xsde.cxx index 566ce61..e4637dd 100644 --- a/xsde/xsde.cxx +++ b/xsde/xsde.cxx @@ -9,8 +9,7 @@ #include // std::auto_ptr #include // std::size_t #include - -#include +#include #include @@ -424,7 +423,7 @@ main (int argc, char* argv[]) try { - tu = SemanticGraph::Path (files[i], boost::filesystem::native); + tu = SemanticGraph::Path (files[i]); } catch (SemanticGraph::InvalidPath const&) { @@ -446,7 +445,7 @@ main (int argc, char* argv[]) { if (xml_schema_file = common_ops.extern_xml_schema ()) { - if (tu.native_file_string () != xml_schema_file) + if (tu.string () != xml_schema_file) gen_xml_schema = false; } } @@ -468,8 +467,7 @@ main (int argc, char* argv[]) for (; ai < files.size (); ++ai) { if (ai != i && files[ai] != xml_schema_file) - paths.push_back ( - SemanticGraph::Path (files[ai], boost::filesystem::native)); + paths.push_back (SemanticGraph::Path (files[ai])); } } catch (SemanticGraph::InvalidPath const&) @@ -489,8 +487,7 @@ main (int argc, char* argv[]) { for (; i != extra_files.end (); ++i) { - paths.push_back ( - SemanticGraph::Path (*i, boost::filesystem::native)); + paths.push_back (SemanticGraph::Path (*i)); } } catch (SemanticGraph::InvalidPath const&) @@ -523,7 +520,7 @@ main (int argc, char* argv[]) Transformations::Anonymous trans (anon_translator); if (multi) - trans.transform (*schema, "", true); + trans.transform (*schema, SemanticGraph::Path (), true); else trans.transform (*schema, tu, true); } @@ -547,7 +544,7 @@ main (int argc, char* argv[]) Transformations::Simplifier trans; if (multi) - trans.transform (*schema, ""); + trans.transform (*schema, SemanticGraph::Path ()); else trans.transform (*schema, tu); } @@ -560,7 +557,7 @@ main (int argc, char* argv[]) { if (multi) CXX::Hybrid::Generator::calculate_size ( - *h_ops, *schema, "", disabled_w); + *h_ops, *schema, SemanticGraph::Path (), disabled_w); else CXX::Hybrid::Generator::calculate_size ( *h_ops, *schema, tu, disabled_w); @@ -579,7 +576,9 @@ main (int argc, char* argv[]) Processing::Inheritance::Processor proc; if (multi) - proc.process (*schema, "", gen_hybrid ? "fixed" : 0); + proc.process (*schema, + SemanticGraph::Path (), + gen_hybrid ? "fixed" : 0); else proc.process (*schema, tu, gen_hybrid ? "fixed" : 0); } @@ -597,7 +596,7 @@ main (int argc, char* argv[]) Transformations::Restriction trans; if (multi) - trans.transform (*schema, ""); + trans.transform (*schema, SemanticGraph::Path ()); else trans.transform (*schema, tu); } @@ -810,8 +809,7 @@ main (int argc, char* argv[]) { try { - paths.push_back ( - SemanticGraph::Path (files[i], boost::filesystem::native)); + paths.push_back (SemanticGraph::Path (files[i])); } catch (SemanticGraph::InvalidPath const&) { @@ -846,7 +844,7 @@ main (int argc, char* argv[]) try { Transformations::Anonymous trans (anon_translator); - trans.transform (*schema, "", false); + trans.transform (*schema, SemanticGraph::Path (), false); } catch (Transformations::Anonymous::Failed const&) { @@ -859,14 +857,14 @@ main (int argc, char* argv[]) if (gen_hybrid) { Transformations::EnumSynthesis trans; - trans.transform (*schema, ""); + trans.transform (*schema, SemanticGraph::Path ()); } // Simplify the schema graph. // { Transformations::Simplifier trans; - trans.transform (*schema, ""); + trans.transform (*schema, SemanticGraph::Path ()); } // Calculate type sizes. @@ -876,7 +874,7 @@ main (int argc, char* argv[]) try { CXX::Hybrid::Generator::calculate_size ( - *h_ops, *schema, "", disabled_w); + *h_ops, *schema, SemanticGraph::Path (), disabled_w); } catch (CXX::Hybrid::Generator::Failed const&) { @@ -891,7 +889,7 @@ main (int argc, char* argv[]) try { Transformations::Restriction trans; - trans.transform (*schema, ""); + trans.transform (*schema, SemanticGraph::Path ()); } catch (Transformations::Restriction::Failed const&) { @@ -1063,14 +1061,14 @@ main (int argc, char* argv[]) // if (NarrowString fl = common_ops.file_list ()) { - typedef boost::filesystem::ofstream OutputFileStream; + typedef std::ofstream OutputFileStream; try { OutputFileStream ofs; SemanticGraph::Path path (fl); - ofs.open (fl, ios_base::out); + ofs.open (path.string ().c_str (), ios_base::out); if (!ofs.is_open ()) { @@ -1272,7 +1270,7 @@ AnonymousNameTranslator (NarrowStrings const& regex, bool trace) catch (RegexFormat const& e) { wcerr << "error: invalid anonymous type regex: '" << - e.regex () << "': " << e.description () << endl; + e.regex () << "': " << e.description ().c_str () << endl; throw Failed (); } @@ -1335,7 +1333,7 @@ SchemaPerTypeTranslator (NarrowStrings const& type_regex, catch (TypeRegexFormat const& e) { wcerr << "error: invalid type file regex: '" << - e.regex () << "': " << e.description () << endl; + e.regex () << "': " << e.description ().c_str () << endl; throw Failed (); } diff --git a/xsde/xsde.hxx b/xsde/xsde.hxx index 41b0cba..7ceb3f8 100644 --- a/xsde/xsde.hxx +++ b/xsde/xsde.hxx @@ -11,6 +11,7 @@ #include // std::remove #include +#include #include // Path @@ -19,54 +20,7 @@ typedef std::set WarningSet; typedef std::vector FileList; -// -// -struct AutoUnlink -{ - AutoUnlink (XSDFrontend::SemanticGraph::Path const& file) - : file_ (file), canceled_ (false) - { - } - - ~AutoUnlink () - { - if (!canceled_) - std::remove (file_.native_file_string ().c_str ()); - } - - void - cancel () - { - canceled_ = true; - } - -private: - XSDFrontend::SemanticGraph::Path file_; - bool canceled_; -}; - -// -// -struct AutoUnlinks -{ - void - add (XSDFrontend::SemanticGraph::Path const& file) - { - unlinks_.push_back( - cutl::shared_ptr ( - new (shared) AutoUnlink (file))); - } - - void - cancel () - { - for (Unlinks::iterator i (unlinks_.begin ()); i != unlinks_.end (); ++i) - (*i)->cancel (); - } - -private: - typedef std::vector > Unlinks; - Unlinks unlinks_; -}; +typedef cutl::fs::auto_remove AutoUnlink; +typedef cutl::fs::auto_removes AutoUnlinks; #endif // XSDE_HXX -- cgit v1.1