Skip to content

Commit

Permalink
Added improved summary mode.
Browse files Browse the repository at this point in the history
[SVN r25144]
  • Loading branch information
jzmaddock committed Sep 16, 2004
1 parent 1c8b0fc commit ac03dbb
Show file tree
Hide file tree
Showing 9 changed files with 244 additions and 201 deletions.
4 changes: 2 additions & 2 deletions add_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ void bcp_implementation::add_file_dependencies(const fs::path& p, bool scanfile)
view.open(p);
else
view.open(m_boost_path / p);
if(m_licence_mode && !scanfile)
scan_licence(p, view);
if(m_license_mode && !scanfile)
scan_license(p, view);
boost::regex_token_iterator<const char*> i(view.begin(), view.end(), e, 1);
boost::regex_token_iterator<const char*> j;
while(i != j)
Expand Down
2 changes: 1 addition & 1 deletion bcp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class bcp_application
virtual void enable_cvs_mode() = 0;
virtual void enable_unix_lines() = 0;
virtual void enable_scan_mode() = 0;
virtual void enable_licence_mode() = 0;
virtual void enable_license_mode() = 0;
virtual void enable_bsl_convert_mode() = 0;
virtual void enable_bsl_summary_mode() = 0;
virtual void set_boost_path(const char* p) = 0;
Expand Down
14 changes: 7 additions & 7 deletions bcp_imp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <string>

bcp_implementation::bcp_implementation()
: m_list_mode(false), m_licence_mode(false), m_cvs_mode(false), m_unix_lines(false), m_scan_mode(false), m_bsl_convert_mode(false)
: m_list_mode(false), m_license_mode(false), m_cvs_mode(false), m_unix_lines(false), m_scan_mode(false), m_bsl_convert_mode(false)
{
}

Expand All @@ -45,9 +45,9 @@ void bcp_implementation::enable_scan_mode()
m_scan_mode = true;
}

void bcp_implementation::enable_licence_mode()
void bcp_implementation::enable_license_mode()
{
m_licence_mode = true;
m_license_mode = true;
}

void bcp_implementation::enable_bsl_convert_mode()
Expand Down Expand Up @@ -85,7 +85,7 @@ int bcp_implementation::run()
//
// check output path is OK:
//
if(!m_list_mode && !m_licence_mode && !fs::exists(m_dest_path))
if(!m_list_mode && !m_license_mode && !fs::exists(m_dest_path))
{
std::string msg("Destination path does not exist: ");
msg.append(m_dest_path.native_file_string());
Expand All @@ -99,7 +99,7 @@ int bcp_implementation::run()
scan_cvs_path(fs::path());
}
//
// if in licence mode, try to load more/blanket_permission.txt
// if in license mode, try to load more/blanket_permission.txt
//
fs::path blanket_permission(m_boost_path / "more" / "blanket-permission.txt");
if (fs::exists(blanket_permission)) {
Expand Down Expand Up @@ -178,7 +178,7 @@ int bcp_implementation::run()
std::set<fs::path, path_less>::iterator m, n;
m = m_copy_paths.begin();
n = m_copy_paths.end();
if(!m_licence_mode)
if(!m_license_mode)
{
while(m != n)
{
Expand All @@ -190,7 +190,7 @@ int bcp_implementation::run()
}
}
else
output_licence_info();
output_license_info();
return 0;
}

Expand Down
16 changes: 8 additions & 8 deletions bcp_imp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct path_less
{ return compare_paths(a, b) < 0; }
};

struct licence_data
struct license_data
{
std::set<fs::path, path_less> files;
std::set<std::string> authors;
Expand All @@ -52,7 +52,7 @@ class bcp_implementation
void enable_cvs_mode();
void enable_unix_lines();
void enable_scan_mode();
void enable_licence_mode();
void enable_license_mode();
void enable_bsl_convert_mode();
void enable_bsl_summary_mode();
void set_boost_path(const char* p);
Expand All @@ -73,13 +73,13 @@ class bcp_implementation
bool is_binary_file(const fs::path& p);
void add_dependent_lib(const std::string& libname, const fs::path& p);
void create_path(const fs::path& p);
// licence code:
void scan_licence(const fs::path& p, const fileview& v);
void output_licence_info();
// license code:
void scan_license(const fs::path& p, const fileview& v);
void output_license_info();

std::list<std::string> m_module_list; // the modules to process
bool m_list_mode; // list files only
bool m_licence_mode; // generate licence information for files listed
bool m_license_mode; // generate license information for files listed
bool m_cvs_mode; // check cvs for files
bool m_unix_lines; // fix line endings
bool m_scan_mode; // scan non-boost files.
Expand All @@ -89,8 +89,8 @@ class bcp_implementation
fs::path m_dest_path; // the path to copy to
std::map<fs::path, bool, path_less> m_cvs_paths; // valid files under cvs control
std::set<fs::path, path_less> m_copy_paths; // list of files to copy
std::map<int, licence_data> m_licence_data; // licences in use
std::set<fs::path, path_less> m_unknown_licences; // files with no known licence
std::map<int, license_data> m_license_data; // licenses in use
std::set<fs::path, path_less> m_unknown_licenses; // files with no known license
std::set<fs::path, path_less> m_unknown_authors; // files with no known copyright/author
std::set<fs::path, path_less> m_can_migrate_to_bsl; // files that can migrate to the BSL
std::set<fs::path, path_less> m_cannot_migrate_to_bsl; // files that cannot migrate to the BSL
Expand Down
Loading

0 comments on commit ac03dbb

Please sign in to comment.