|
From: Foster B. <fos...@us...> - 2005-04-22 23:03:09
|
Update of /cvsroot/adobe-source/sandbox/visual_refactor/adobe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1071/visual_refactor/adobe Modified Files: xstr.hpp Log Message: new xstring implementation; visual building again on Mac Index: xstr.hpp =================================================================== RCS file: /cvsroot/adobe-source/sandbox/visual_refactor/adobe/xstr.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** xstr.hpp 18 Apr 2005 21:15:35 -0000 1.1 --- xstr.hpp 22 Apr 2005 23:02:28 -0000 1.2 *************** *** 12,100 **** /*************************************************************************************************/ - #include <adobe/name_fwd.hpp> #include <adobe/dictionary_fwd.hpp> ! #include <adobe/algorithm.hpp> ! ! /*************************************************************************************************/ ! ! namespace adobe { ! /*************************************************************************************************/ ! class xstr_t; /*************************************************************************************************/ ! } // namespace adobe /*************************************************************************************************/ ! #if !defined(ADOBE_NO_DOCUMENTATION) ! ! void swap(adobe::xstr_t& x, adobe::xstr_t& y); ! #endif /*************************************************************************************************/ ! namespace adobe { ! /*************************************************************************************************/ ! class xstr_t ! { ! public: ! typedef std::pair<const char*, const char*> parse_range_t; ! explicit xstr_t(const char* xstr); ! xstr_t(const char* xstr, std::size_t n); ! xstr_t(const char* xstr, std::size_t n, const adobe::dictionary_t& context); ! #if !defined(ADOBE_NO_DOCUMENTATION) ! xstr_t(const xstr_t& rhs); ! ~xstr_t(); ! xstr_t& operator = (const xstr_t& rhs); ! #endif ! const char* get() const; ! static void assign_glossary(const parse_range_t& parse_range); ! static void append_glossary(const parse_range_t& parse_range); ! static void set_default_context(const adobe::dictionary_t& context); ! static adobe::dictionary_t get_default_context(); private: - - #if !defined(ADOBE_NO_DOCUMENTATION) - - friend void ::swap(adobe::xstr_t& x, adobe::xstr_t& y); - struct implementation_t; implementation_t* object_m; - - #endif - }; /*************************************************************************************************/ ! } // namespace adobe /*************************************************************************************************/ ! #if !defined(ADOBE_NO_DOCUMENTATION) ! ! inline void swap(adobe::xstr_t& x, adobe::xstr_t& y) ! { adobe::swap(x.object_m, y.object_m); } ! ! #endif /*************************************************************************************************/ --- 12,89 ---- /*************************************************************************************************/ #include <adobe/dictionary_fwd.hpp> ! #include <adobe/name.hpp> ! #include <boost/function.hpp> ! #include <string> ! #include <istream> ! #include <vector> /*************************************************************************************************/ ! namespace adobe { /*************************************************************************************************/ ! typedef std::pair<adobe::name_t, adobe::name_t> attribute_t; ! typedef std::vector<attribute_t> attribute_set_t; ! typedef boost::function<std::string ( const adobe::name_t&, ! const attribute_set_t&, ! const std::string& value)> xml_element_proc_t; /*************************************************************************************************/ ! // Add a file to the xstring glossary global singleton ! // (might have FILE and LINE parameters for debug info.) ! void xstring_glossary(std::istream& stream); ! void xstring_glossary(std::istream& stream, const adobe::dictionary_t& context); ! // Parses an XML fragment ! std::string parse_xml_fragment(const std::string& fragment, const xml_element_proc_t proc); ! // All of these functions return a valid XML fragment ! std::string xstring(const char* xstr); ! std::string xstring(const char* xstr, std::size_t n); ! std::string xstring(const std::string& xstr); ! std::string xstring(const char* xstr, const adobe::dictionary_t& context); ! std::string xstring(const char* xstr, std::size_t n, const adobe::dictionary_t& context); ! std::string xstring(const std::string& xstr, const adobe::dictionary_t& context); ! // Converts an xml fragment to utf-8, any unknown markup is stripped. ! std::string finalize_xml_fragment(const std::string& fragment); ! /*************************************************************************************************/ ! // sets the default context (default context is thread local storage) with a global base context that picks up platform and locale ! struct xstring_context_t ! { ! explicit xstring_context_t(const attribute_set_t&); ! ~xstring_context_t(); private: struct implementation_t; implementation_t* object_m; }; /*************************************************************************************************/ ! std::string xml_element_echo( const adobe::name_t& name, ! const adobe::attribute_set_t& attribute_set, ! const std::string& value); /*************************************************************************************************/ ! } // namespace adobe /*************************************************************************************************/ |