OSDN Git Service

roast_xml/sax_generator.hpp: text2print()対応
authorMyun2 <myun2@nwhite.info>
Sun, 10 Oct 2010 09:13:46 +0000 (18:13 +0900)
committerMyun2 <myun2@nwhite.info>
Sun, 10 Oct 2010 09:13:46 +0000 (18:13 +0900)
roast/include/roast/xml/roast_xml/sax_generator.hpp
roast/test/lexical_test/sax_test.cpp
roast/test/lexical_test/temp.xml

index 123f8cf..24b16d5 100644 (file)
@@ -127,8 +127,7 @@ namespace roast
                class text2print : public _rax_select_base
                {
                public:
-                       void operator()(){
-                       }
+                       virtual bool text( const sized_ccharbuf &s ){ fwrite(s.ptr, 1, s.size, stdout); return true; }
                };
 
                //////////////////////////////////////////////////////////////////////////
index 60981c7..a16844d 100644 (file)
@@ -55,7 +55,8 @@ int main()
                saxpar.analyze(work,
                        rax
                        / "hoge"
-                       / text2str(s) );
+                       / "hoge"
+                       / text2print() );
                /*      saxpar.analyze((const char*)work,
                        rax /"statuses"/"status"/
                                text2int(id) &&
@@ -65,7 +66,7 @@ int main()
                );*/
                        //saxgen /"statuses"/"status"/ ( el("!user")/status_append_o || el("user")/user ) );
                        //saxgen / el("statuses") / el("status") / (  );
-               printf("%s\n", s.c_str());
+               //printf("%s\n", s.c_str());
        }
        /*catch(...)
        {
index fe389ef..1adc82d 100644 (file)
@@ -7,4 +7,10 @@ version
  encoding =
   "UTF-8"
 ?>
-<hoge>bbbb</hoge>
\ No newline at end of file
+<hoge>
+<hoge>aaaa</hoge>
+<hoge></hoge>
+<hoge>bbbb</hoge>
+<hoge>
+</hoge>
+</hoge>
\ No newline at end of file