Changeset 72
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Directory.cc
r71 r72 7 7 #include <algorithm> 8 8 #include <fstream> 9 #include <functional> 9 10 #include <iostream> 10 11 #include <iterator> … … 65 66 stats_.reset(); 66 67 67 // empty directory treated as one-liner file68 if (daughters_.empty())69 stats_.parse(path_,true);70 71 68 for (NodeIterator i=daughters_.begin(); i!=daughters_.end(); i++) 72 69 stats_ += (*i)->parse(verbose); … … 86 83 os << std::endl; 87 84 88 // Peter, use for_each 89 for (NodeConstIter_ i=daughters_.begin();i!=daughters_.end();i++){ 90 (*i)->print_link(os); 91 os << "<br/>" << std::endl; 92 } 85 // print html links to daughter nodes 86 transform(daughters_.begin(), daughters_.end(), 87 std::ostream_iterator<std::string>(os,"\n"), 88 std::mem_fun(&Node::html_link)); 93 89 94 90 print_footer(os); 95 91 os.close(); 96 92 97 // Peter, use for_each 98 for (NodeConstIter_ i=daughters_.begin();i!=daughters_.end();i++) 99 (*i)->print(verbose); 93 // print daughter nodes, i.e, this function is recursive 94 for_each(daughters_.begin(), daughters_.end(), 95 std::bind1st(std::mem_fun(&Node::print), verbose)); 96 100 97 } 101 98 -
trunk/lib/File.cc
r63 r72 26 26 ss >> revision_; 27 27 28 binary_ = stats_.parse(path_ , binary_);28 binary_ = stats_.parse(path_); 29 29 return stats_; 30 30 } -
trunk/lib/File.h
r60 r72 18 18 /// 19 19 File(const std::string& path, const std::string& output="") 20 : Node(path,output), binary_(false) {}20 : Node(path,output), binary_(false), ignore_(false) {} 21 21 22 22 /// … … 47 47 std::string author_; 48 48 bool binary_; 49 bool ignore_; 49 50 u_int revision_; 50 51 -
trunk/lib/Node.cc
r71 r72 51 51 52 52 53 std::string Node::html_link(void) const 54 { 55 return "<a href=\"" + output_name() + ".html\">" + name() + "</a><br/>"; 56 } 57 53 58 bool Node::subversion_controlled(void) const 54 59 { -
trunk/lib/Node.h
r60 r72 8 8 #include <ostream> 9 9 #include <string> 10 #include <sstream> 10 11 11 12 namespace theplu{ … … 28 29 virtual inline ~Node(void) {}; 29 30 30 const std::string& output_name(void) const { return output_name_; }31 inline const std::string& output_name(void) const { return output_name_; } 31 32 32 33 /// … … 41 42 42 43 /// 43 /// Prints ahtml link.44 /// @return html link. 44 45 /// 45 inline void print_link(std::ostream& os) const 46 { os << "<a href=\"" << output_name() << ".html\">" << name() << "</a>"; } 46 std::string html_link(void) const; 47 47 48 48 /// -
trunk/lib/Stats.cc
r65 r72 66 66 67 67 68 bool Stats::parse(const std::string& path , const bool binary)68 bool Stats::parse(const std::string& path) 69 69 { 70 if (binary){71 std::map<std::string,std::string> svn_info = info(path);72 std::stringstream ss(svn_info["Last Changed Rev"]);73 u_int revision;74 ss >> revision;75 add(svn_info["Last Changed Author"],revision);76 return true;77 }78 79 70 // Calling svn blame 80 71 if (blame(path)) … … 89 80 if (line==std::string("binary")){ 90 81 is.close(); 91 return parse(path,true);82 return true; 92 83 } 93 84 } -
trunk/lib/Stats.h
r71 r72 29 29 /// @return true if file is binary 30 30 /// 31 bool parse(const std::string& , const bool);31 bool parse(const std::string&); 32 32 33 33 ///
Note: See TracChangeset
for help on using the changeset viewer.