|
Boost-Commit : |
From: ramey_at_[hidden]
Date: 2007-09-22 17:24:41
Author: ramey
Date: 2007-09-22 17:24:41 EDT (Sat, 22 Sep 2007)
New Revision: 39484
URL: http://svn.boost.org/trac/boost/changeset/39484
Log:
merged in changes - tested with gcc and msvc
Text files modified:
trunk/tools/regression/library_status.cpp | 40 ++++++++++++++++++++++++----------------
1 files changed, 24 insertions(+), 16 deletions(-)
Modified: trunk/tools/regression/library_status.cpp
==============================================================================
--- trunk/tools/regression/library_status.cpp (original)
+++ trunk/tools/regression/library_status.cpp 2007-09-22 17:24:41 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>
@@ -89,12 +90,12 @@
struct col_node {
int rows, cols;
- bool is_leaf_directory;
+ 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();
};
@@ -102,20 +103,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)){
@@ -124,11 +133,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;
@@ -210,7 +217,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;
@@ -538,7 +545,7 @@
bool profile
){
bool retval = false;
- if(node.is_leaf_directory){
+ if(node.has_leaf){
retval = do_cell(
dir_root,
lib_name,
@@ -687,9 +694,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