Changeset 22565 for lang/cplusplus/boost-supplement
- Timestamp:
- 11/02/08 13:21:19 (5 years ago)
- Location:
- lang/cplusplus/boost-supplement/trunk
- Files:
-
- 2 modified
-
ChangeLog (modified) (1 diff)
-
boost_supplement/graph/read_lgl.hpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/cplusplus/boost-supplement/trunk/ChangeLog
r21208 r22565 1 2008-11-02 Kenta Murata <mrkn@mrkn.jp> 2 3 * boost_supplement/graph/read_lgl.hpp (boost_supplement::detail::lgl_reader::read): conserving vertex order. 4 1 5 2008-10-13 Kenta Murata <mrkn@mrkn.jp> 2 6 -
lang/cplusplus/boost-supplement/trunk/boost_supplement/graph/read_lgl.hpp
r21200 r22565 9 9 #include <boost_supplement/graph/detail/line_input_iterator.hpp> 10 10 11 #include <list> 11 12 #include <map> 12 13 … … 28 29 NameVertexMap nvm_; 29 30 std::string base_; 31 std::list<std::string> lines_; 30 32 31 33 Vertex name_to_vertex(std::string const& n) … … 41 43 } 42 44 43 void process_line(std::string const& line) 45 void process_line_1(std::string const& line) 46 { 47 using namespace std; 48 using namespace boost; 49 50 tokenizer tokens(line, SEP); 51 tokenizer::iterator tok_iter = tokens.begin(); 52 string tok1(*tok_iter++); 53 if ("#" == tok1) { 54 if (tok_iter == tokens.end()) { 55 // TODO: Syntax error 56 return; 57 } 58 name_to_vertex(*tok_iter); 59 } 60 } 61 62 void process_line_2(std::string const& line) 44 63 { 45 64 using namespace std; … … 79 98 vnm_(&n), 80 99 ewm_(&w), 81 base_("") 100 base_(""), 101 lines_() 82 102 {} 83 103 … … 86 106 { 87 107 graph_->clear(); 108 // pass 1: adding vertices 88 109 for (line_input_iterator<InputStream> line_iter(is); 89 110 line_iter != line_input_iterator<InputStream>(); 90 111 ++line_iter) { 91 process_line(*line_iter); 112 process_line_1(*line_iter); 113 lines_.push_back(*line_iter); 114 } 115 // pass 2: adding edges 116 for (std::list<std::string>::iterator line_iter = lines_.begin(); 117 line_iter != lines_.end(); ++line_iter) { 118 process_line_2(*line_iter); 92 119 } 93 120
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)