From baa5e959a5e2a3863a6cf7eb2587032ae0b4669a Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 21 Jul 2003 16:55:58 +0000 Subject: [PATCH] allow os-specific filenames on interrogate command line --- dtool/src/cppparser/cppParser.cxx | 2 +- dtool/src/cppparser/cppParser.h | 3 ++- dtool/src/interrogate/interrogate.cxx | 11 ++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dtool/src/cppparser/cppParser.cxx b/dtool/src/cppparser/cppParser.cxx index 695a677ae2..0f50bd3520 100644 --- a/dtool/src/cppparser/cppParser.cxx +++ b/dtool/src/cppparser/cppParser.cxx @@ -57,7 +57,7 @@ is_fully_specified() const { // Description: //////////////////////////////////////////////////////////////////// bool CPPParser:: -parse_file(const string &filename) { +parse_file(const Filename &filename) { if (!init_cpp(CPPFile(filename, filename, CPPFile::S_local))) { cerr << "Unable to read " << filename << "\n"; return false; diff --git a/dtool/src/cppparser/cppParser.h b/dtool/src/cppparser/cppParser.h index 7cd4211e55..189ae558a3 100644 --- a/dtool/src/cppparser/cppParser.h +++ b/dtool/src/cppparser/cppParser.h @@ -23,6 +23,7 @@ #include "cppScope.h" #include "cppPreprocessor.h" +#include "filename.h" #include @@ -36,7 +37,7 @@ public: virtual bool is_fully_specified() const; - bool parse_file(const string &filename); + bool parse_file(const Filename &filename); CPPExpression *parse_expr(const string &expr); CPPType *parse_type(const string &type); diff --git a/dtool/src/interrogate/interrogate.cxx b/dtool/src/interrogate/interrogate.cxx index c456406765..1bfa8ed53c 100644 --- a/dtool/src/interrogate/interrogate.cxx +++ b/dtool/src/interrogate/interrogate.cxx @@ -327,11 +327,11 @@ main(int argc, char *argv[]) { break; case CO_oc: - output_code_filename = optarg; + output_code_filename = Filename::from_os_specific(optarg); break; case CO_od: - output_data_filename = optarg; + output_data_filename = Filename::from_os_specific(optarg); break; case CO_module: @@ -444,11 +444,12 @@ main(int argc, char *argv[]) { // Get all of the .h files. for (i = 1; i < argc; ++i) { - if (!parser.parse_file(argv[i])) { + Filename filename = Filename::from_os_specific(argv[i]); + if (!parser.parse_file(Filename::from_os_specific(filename))) { cerr << "Error parsing file: '" << argv[i] << "'\n"; exit(1); } - builder.add_source_file(argv[i]); + builder.add_source_file(filename); } // Now that we've parsed all the source code, change the way things @@ -459,7 +460,7 @@ main(int argc, char *argv[]) { // Now look for the .N files. for (i = 1; i < argc; ++i) { - Filename nfilename = argv[i]; + Filename nfilename = Filename::from_os_specific(argv[i]); nfilename.set_extension("N"); nfilename.set_text(); ifstream nfile;