00001 // This is brl/bbas/bxml/bxml_read.h 00002 #ifndef bxml_read_h_ 00003 #define bxml_read_h_ 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 //: 00008 // \file 00009 // \brief functions to parse XML documents 00010 // \author Matt Leotta (Brown) 00011 // \date October 5, 2006 00012 // 00013 // \verbatim 00014 // Modifications 00015 // <none yet> 00016 // \endverbatim 00017 00018 #include "bxml_document.h" 00019 #include <vcl_iostream.h> 00020 00021 //: Read the entire contents of \p filepath into an XML document class 00022 bxml_document bxml_read(const vcl_string& filepath); 00023 00024 //: Read the entire data stream \p is into an XML document class 00025 bxml_document bxml_read(vcl_istream& is); 00026 00027 //: Read an XML stream one element at a time 00028 class bxml_stream_read 00029 { 00030 public: 00031 //: Constructor 00032 // only elements with depth <= max_depth are returned 00033 explicit bxml_stream_read(int max_depth = -1); 00034 00035 // Destructor 00036 ~bxml_stream_read(); 00037 00038 //: Reset the state of the reader 00039 void reset(); 00040 00041 //: Read the next element 00042 bxml_data_sptr next_element(vcl_istream& is, unsigned int& depth); 00043 00044 private: // Private implementation 00045 class pimpl; 00046 pimpl* p_; 00047 }; 00048 00049 #endif // bxml_read_h_