diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-04-11 18:19:17 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-04-11 19:20:07 (GMT) |
commit | 857e44c156a1dbefcb49bb5792c4384cebd8762a (patch) | |
tree | 11947fb81ad9c502627f1b2bb8f090fb8d53c107 /3rdParty/Boost/src/tools/bcp/bcp_imp.cpp | |
parent | 77d4eb7588e113beaa03f3347523b26adefdeb06 (diff) | |
download | swift-contrib-857e44c156a1dbefcb49bb5792c4384cebd8762a.zip swift-contrib-857e44c156a1dbefcb49bb5792c4384cebd8762a.tar.bz2 |
Updated Boost to 1.42.
Diffstat (limited to '3rdParty/Boost/src/tools/bcp/bcp_imp.cpp')
-rw-r--r-- | 3rdParty/Boost/src/tools/bcp/bcp_imp.cpp | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/3rdParty/Boost/src/tools/bcp/bcp_imp.cpp b/3rdParty/Boost/src/tools/bcp/bcp_imp.cpp index f00f022..c5d7fb4 100644 --- a/3rdParty/Boost/src/tools/bcp/bcp_imp.cpp +++ b/3rdParty/Boost/src/tools/bcp/bcp_imp.cpp @@ -18,7 +18,9 @@ #include <string> bcp_implementation::bcp_implementation() - : m_list_mode(false), m_list_summary_mode(false), m_license_mode(false), m_cvs_mode(false), m_svn_mode(false), m_unix_lines(false), m_scan_mode(false), m_bsl_convert_mode(false), m_bsl_summary_mode(false) + : m_list_mode(false), m_list_summary_mode(false), m_license_mode(false), m_cvs_mode(false), + m_svn_mode(false), m_unix_lines(false), m_scan_mode(false), m_bsl_convert_mode(false), + m_bsl_summary_mode(false), m_namespace_alias(false), m_list_namespaces(false) { } @@ -100,6 +102,22 @@ void bcp_implementation::add_module(const char* p) m_module_list.push_back(p); } +void bcp_implementation::set_namespace(const char* name) +{ + m_namespace_name = name; +} + +void bcp_implementation::set_namespace_alias(bool b) +{ + m_namespace_alias = b; +} + +void bcp_implementation::set_namespace_list(bool b) +{ + m_list_namespaces = b; + m_list_mode = b; +} + fs::path get_short_path(const fs::path& p) { // truncate path no more than "x/y": @@ -152,7 +170,7 @@ int bcp_implementation::run() fs::ifstream in(blanket_permission); std::string line; while (std::getline(in, line)) { - boost::regex e("([^(]+)\\("); + static const boost::regex e("([^(]+)\\("); boost::smatch result; if (boost::regex_search(line, result, e)) m_bsl_authors.insert(format_authors_name(result[1])); @@ -221,6 +239,33 @@ int bcp_implementation::run() // // now perform output: // + if(m_list_namespaces) + { + // List the namespaces, in two lists, headers and source files + // first, then everything else afterwards: + // + boost::regex important_file("boost/.*|libs/[^/]*/(?:[^/]*/)?/src/.*"); + std::map<std::string, fs::path>::const_iterator i, j; + i = m_top_namespaces.begin(); + j = m_top_namespaces.end(); + std::cout << "\n\nThe top level namespaces found for header and source files were:\n"; + while(i != j) + { + if(regex_match(i->second.string(), important_file)) + std::cout << i->first << " (from " << i->second << ")" << std::endl; + ++i; + } + + i = m_top_namespaces.begin(); + std::cout << "\n\nThe top level namespaces found for all other source files were:\n"; + while(i != j) + { + if(!regex_match(i->second.string(), important_file)) + std::cout << i->first << " (from " << i->second << ")" << std::endl; + ++i; + } + return 0; + } std::set<fs::path, path_less>::iterator m, n; std::set<fs::path, path_less> short_paths; m = m_copy_paths.begin(); |