OSDN Git Service

element...
authorMyun2 <myun2@nwhite.info>
Thu, 22 Jul 2010 18:00:07 +0000 (03:00 +0900)
committerMyun2 <myun2@nwhite.info>
Thu, 22 Jul 2010 18:00:07 +0000 (03:00 +0900)
roast/include/roast/xml/roast_xml/structure.hpp

index 5d94853..bb391f7 100644 (file)
@@ -133,10 +133,6 @@ namespace roast
                        class noelems_ : public seq2<noelems, T>{};
 
                        //////////////////////////////////////////////////////////////////
-                       
-                       class element
-                       {
-                       };
 
                        class attr
                        {
@@ -196,6 +192,61 @@ namespace roast
                        {
                        };
 
+                       /*typedef normal_tag;
+                       typedef empty_elem_tag;
+                       typedef or<normal_tag, empty_elem_tag> tag;*/
+                       
+                       
+                       class element
+                       {
+                       public:
+                               template <typename T>
+                               bool analyze(T& it)
+                               {
+                                       lesser lesser_inst;
+                                       lesser_inst.analyze(it);
+
+                                       //      Tag Name
+                                       get_string_end_analyze< equal, T> gs;
+                                       //get_string_end_analyze< or<noreqws, equal>, T> gs;
+                                       gs.analyze(it);
+                                       sized_ptr_<typename T::ValueType> str(&*gs.start_it, gs.end_it - gs.start_it);
+                                       sized_ccharbuf cb(str.ptr, str.size);
+                                       printf( cb.to_string().c_str() );
+
+                                       //      Skip =
+                                       it++;
+
+                                       /////////////////////////////////////////////
+
+                                       //      Whitespaces...
+                                       noreqws noreqws_inst;
+                                       noreqws_inst.analyze(it);
+
+                                       //      Start Double Quote
+                                       dblquote dblquote_inst;
+                                       if ( dblquote_inst.analyze(it) == false )
+                                               return false;
+
+                                       /////////////////////////////////////////////
+
+                                       //      Attribute Name
+                                       get_string_end_analyze< dblquote, T> gs_value;
+                                       gs_value.analyze(it);
+                                       sized_ptr_<typename T::ValueType> str2(&*gs_value.start_it, gs_value.end_it - gs_value.start_it);
+                                       sized_ccharbuf cb2(str2.ptr, str2.size);
+                                       printf( cb2.to_string().c_str() );
+
+                                       //      End Double Quote
+                                       if ( dblquote_inst.analyze(it) == false )
+                                               return false;
+
+                                       return true;
+                               }
+                       };
+                       
+                       //typedef seq<lesser, get_string_end_analyze< equal, T> greater> element;
+
                        class body
                        {
                        public:
@@ -205,6 +256,7 @@ namespace roast
                                        return true;
                                }
                        };
+                       //typedef element body;
                        
                        /*class header
                        {