Boost logo

Boost-Commit :

From: ramey_at_[hidden]
Date: 2007-09-22 17:01:17


Author: ramey
Date: 2007-09-22 17:01:15 EDT (Sat, 22 Sep 2007)
New Revision: 39483
URL: http://svn.boost.org/trac/boost/changeset/39483

Log:
remove const on map argument
Text files modified:
   branches/serialization_next_release/boost/tools/regression/library_status.cpp | 56 ++++++++++++++++++++++-----------------
   1 files changed, 32 insertions(+), 24 deletions(-)

Modified: branches/serialization_next_release/boost/tools/regression/library_status.cpp
==============================================================================
--- branches/serialization_next_release/boost/tools/regression/library_status.cpp (original)
+++ branches/serialization_next_release/boost/tools/regression/library_status.cpp 2007-09-22 17:01:15 EDT (Sat, 22 Sep 2007)
@@ -37,6 +37,7 @@
 #include <string>
 #include <vector>
 #include <set>
+#include <utility> // for make_pair on STLPort
 #include <map>
 #include <algorithm>
 #include <iostream>
@@ -88,12 +89,12 @@
 
     struct col_node {
         int rows, cols;
- bool is_leaf_directory;
- typedef std::map<const std::string, col_node> subcolumns_t;
+ bool has_leaf;
+ typedef std::map<std::string, col_node> subcolumns_t;
         subcolumns_t m_subcolumns;
         bool operator<(const col_node &cn) const;
         col_node() :
- is_leaf_directory(false)
+ has_leaf(false)
         {}
         std::pair<int, int> get_spans();
     };
@@ -101,20 +102,28 @@
     std::pair<int, int> col_node::get_spans(){
         rows = 1;
         cols = 0;
- if(is_leaf_directory)
+ if(has_leaf){
             cols = 1;
- subcolumns_t::iterator itr;
- for(itr = m_subcolumns.begin(); itr != m_subcolumns.end(); ++itr){
- std::pair<int, int> spans;
- spans = itr->second.get_spans();
- rows = std::max(rows, spans.first);
- cols += spans.second;
         }
- return std::make_pair(rows + 1, cols);
+ if(! m_subcolumns.empty()){
+ subcolumns_t::iterator itr;
+ for(itr = m_subcolumns.begin(); itr != m_subcolumns.end(); ++itr){
+ std::pair<int, int> spans;
+ spans = itr->second.get_spans();
+ rows = std::max(rows, spans.first);
+ cols += spans.second;
+ }
+ ++rows;
+ }
+ return std::make_pair(rows, cols);
     }
 
     void build_node_tree(const fs::path & dir_root, col_node & node){
- bool is_leaf_directory = true;
+ fs::path xml_file_path( dir_root / "test_log.xml" );
+ if (fs::exists( xml_file_path ) )
+ {
+ node.has_leaf = true;
+ }
         fs::directory_iterator itr(dir_root);
         while(itr != end_itr){
             if(fs::is_directory(*itr)){
@@ -123,11 +132,9 @@
                         std::make_pair(itr->leaf(), col_node())
                     );
                 build_node_tree(*itr, result.first->second);
- is_leaf_directory = false;
             }
             ++itr;
         }
- node.is_leaf_directory = is_leaf_directory;
     }
 
     fs::ofstream report;
@@ -209,7 +216,7 @@
     const string & element_content(
         const xml::element & root, const string & name )
     {
- static string empty_string;
+ const static string empty_string;
         xml::element_list::const_iterator itr;
         for ( itr = root.elements.begin();
             itr != root.elements.end() && (*itr)->name != name;
@@ -222,7 +229,7 @@
     const xml::element & find_element(
         const xml::element & root, const string & name )
     {
- const xml::element empty_element;
+ const static xml::element empty_element;
         xml::element_list::const_iterator itr;
         for ( itr = root.elements.begin();
             itr != root.elements.end() && (*itr)->name != name;
@@ -295,12 +302,12 @@
         }
 
         links_file << "<h2><a name=\"";
- links_file << make_pair(
+ links_file << std::make_pair(
             html_from_path(target_dir.string().begin()),
             html_from_path(target_dir.string().end())
             )
             << "\">"
- << make_pair(
+ << std::make_pair(
             html_from_path(target_dir.string().begin()),
             html_from_path(target_dir.string().end())
             )
@@ -337,13 +344,13 @@
                 "See <a href=\"#"
                 << source_library_name << "-"
                 << object_library_name << "-"
- << make_pair(
+ << std::make_pair(
                 html_from_path(target_dir.string().begin()),
                 html_from_path(target_dir.string().end())
                 )
                 << source_library_name << " - "
                 << object_library_name << " - "
- << make_pair(
+ << std::make_pair(
                 html_from_path(target_dir.string().begin()),
                 html_from_path(target_dir.string().end())
                 )
@@ -369,13 +376,13 @@
                 {
                     links_file << "<h2><a name=\""
                         << object_library_name << "-"
- << make_pair(
+ << std::make_pair(
                         html_from_path(target_dir.string().begin()),
                         html_from_path(target_dir.string().end())
                         )
                         << "\">"
                         << object_library_name << " - "
- << make_pair(
+ << std::make_pair(
                         html_from_path(target_dir.string().begin()),
                         html_from_path(target_dir.string().end())
                         )
@@ -537,7 +544,7 @@
         bool profile
     ){
         bool retval = false;
- if(node.is_leaf_directory){
+ if(node.has_leaf){
             retval = do_cell(
                 dir_root,
                 lib_name,
@@ -686,9 +693,10 @@
             }
             return;
         }
- if(node.is_leaf_directory && ! node.m_subcolumns.empty()){
+ if(node.has_leaf && ! node.m_subcolumns.empty()){
             header_cell(row_count - current_row, 1, std::string(""));
         }
+
         col_node::subcolumns_t::const_iterator itr;
         for(itr = node.m_subcolumns.begin(); itr != node.m_subcolumns.end(); ++itr){
             if(1 == itr->second.rows)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk