You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(128) |
Dec
(65) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(48) |
Feb
(132) |
Mar
(95) |
Apr
(47) |
May
(54) |
Jun
(2) |
Jul
(57) |
Aug
(109) |
Sep
(131) |
Oct
(186) |
Nov
(105) |
Dec
(78) |
2007 |
Jan
(125) |
Feb
(105) |
Mar
(52) |
Apr
(104) |
May
(63) |
Jun
(116) |
Jul
(76) |
Aug
|
Sep
(18) |
Oct
(93) |
Nov
(110) |
Dec
(169) |
2008 |
Jan
(90) |
Feb
(64) |
Mar
(41) |
Apr
(23) |
May
(6) |
Jun
(18) |
Jul
(10) |
Aug
(61) |
Sep
(139) |
Oct
(50) |
Nov
(55) |
Dec
(2) |
2009 |
Jan
|
Feb
(1) |
Mar
(62) |
Apr
(22) |
May
(17) |
Jun
(19) |
Jul
(40) |
Aug
(21) |
Sep
|
Oct
(40) |
Nov
(23) |
Dec
|
2010 |
Jan
(14) |
Feb
(40) |
Mar
(9) |
Apr
(11) |
May
(19) |
Jun
(4) |
Jul
(10) |
Aug
(22) |
Sep
(15) |
Oct
|
Nov
(2) |
Dec
|
2011 |
Jan
(13) |
Feb
(10) |
Mar
|
Apr
(13) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(33) |
May
(20) |
Jun
|
Jul
(8) |
Aug
(7) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Braden M. <br...@us...> - 2006-10-25 19:23:26
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19685 Modified Files: ChangeLog Log Message: Accommodate building against Firefox development headers. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1354 retrieving revision 1.1355 diff -C2 -d -r1.1354 -r1.1355 *** ChangeLog 23 Oct 2006 06:39:28 -0000 1.1354 --- ChangeLog 25 Oct 2006 19:23:23 -0000 1.1355 *************** *** 1,2 **** --- 1,12 ---- + 2006-10-25 Braden McDaniel <br...@en...> + + Accommodate building against Firefox development headers. + + * configure.ac: First look for firefox-js; fall back to + mozilla-js. + * openvrml.spec.in: Depend on firefox instead of mozilla. + * mozilla-plugin/configure.ac: First look for firefox-plugin; fall + back to mozilla-plugin. + 2006-10-23 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-10-25 19:23:15
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19635 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Accommodate building against Firefox development headers. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.38 retrieving revision 1.1310.2.39 diff -C2 -d -r1.1310.2.38 -r1.1310.2.39 *** ChangeLog 23 Oct 2006 06:39:17 -0000 1.1310.2.38 --- ChangeLog 25 Oct 2006 19:23:08 -0000 1.1310.2.39 *************** *** 1,2 **** --- 1,12 ---- + 2006-10-25 Braden McDaniel <br...@en...> + + Accommodate building against Firefox development headers. + + * configure.ac: First look for firefox-js; fall back to + mozilla-js. + * openvrml.spec.in: Depend on firefox instead of mozilla. + * mozilla-plugin/configure.ac: First look for firefox-plugin; fall + back to mozilla-plugin. + 2006-10-23 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-10-25 19:15:36
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15753 Modified Files: configure.ac openvrml.spec.in Log Message: Accommodate building against Firefox development headers. Index: configure.ac =================================================================== RCS file: /cvsroot/openvrml/openvrml/configure.ac,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** configure.ac 9 Oct 2006 18:43:09 -0000 1.97 --- configure.ac 25 Oct 2006 19:15:31 -0000 1.98 *************** *** 37,40 **** --- 37,41 ---- # REQUIRE_FONTCONFIG="fontconfig" + REQUIRE_FIREFOX_JS="firefox-js" REQUIRE_MOZILLA_JS="mozilla-js >= 1.2.1" *************** *** 106,110 **** ! PKG_CHECK_MODULES([JS], [$REQUIRE_MOZILLA_JS], , [have_js=no]) PKG_CHECK_MODULES([GTK], [gtk+-2.0], , [have_gtk=no]) AC_PATH_XTRA --- 107,115 ---- ! PKG_CHECK_MODULES([JS], [$REQUIRE_FIREFOX_JS], ! [mozilla_js_pkg=$REQUIRE_FIREFOX_JS], ! [PKG_CHECK_MODULES([JS], [$REQUIRE_MOZILLA_JS], ! [mozilla_js_pkg=$REQUIRE_MOZILLA_JS], ! [have_js=no])]) PKG_CHECK_MODULES([GTK], [gtk+-2.0], , [have_gtk=no]) AC_PATH_XTRA *************** *** 226,233 **** OPENVRML_PKG_REQUIRES="${OPENVRML_PKG_REQUIRES}," fi ! OPENVRML_PKG_REQUIRES="${OPENVRML_PKG_REQUIRES} ${REQUIRE_MOZILLA_JS}" AC_DEFINE([OPENVRML_ENABLE_SCRIPT_NODE_JAVASCRIPT], [1], [Defined if Script node JavaScript support is enabled.]) ! GRE_PATH=`$PKG_CONFIG --libs-only-L mozilla-js | sed -e 's/^-L//' -e 's/ *$//'` if test -n "${openvrml_run_path}" -a -n "${GRE_PATH}"; then openvrml_run_path=":${openvrml_run_path}" --- 231,238 ---- OPENVRML_PKG_REQUIRES="${OPENVRML_PKG_REQUIRES}," fi ! OPENVRML_PKG_REQUIRES="${OPENVRML_PKG_REQUIRES} ${mozilla_js_pkg}" AC_DEFINE([OPENVRML_ENABLE_SCRIPT_NODE_JAVASCRIPT], [1], [Defined if Script node JavaScript support is enabled.]) ! GRE_PATH=`$PKG_CONFIG --libs-only-L ${mozilla_js_pkg%% *} | sed -e 's/^-L//' -e 's/ *$//'` if test -n "${openvrml_run_path}" -a -n "${GRE_PATH}"; then openvrml_run_path=":${openvrml_run_path}" Index: openvrml.spec.in =================================================================== RCS file: /cvsroot/openvrml/openvrml/openvrml.spec.in,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** openvrml.spec.in 5 Oct 2006 05:14:14 -0000 1.55 --- openvrml.spec.in 25 Oct 2006 19:15:31 -0000 1.56 *************** *** 17,21 **** BuildRequires: fontconfig-devel >= 2.0 BuildRequires: freetype-devel >= 2.1.2 ! BuildRequires: mozilla-devel >= 1.6 BuildRequires: mesa-libGLU-devel BuildRequires: libXmu-devel --- 17,21 ---- BuildRequires: fontconfig-devel >= 2.0 BuildRequires: freetype-devel >= 2.1.2 ! BuildRequires: firefox-devel BuildRequires: mesa-libGLU-devel BuildRequires: libXmu-devel *************** *** 26,30 **** Requires: fontconfig >= 2.0 Requires: freetype >= 2.1.2 ! Requires: mozilla >= 1.6 %description --- 26,30 ---- Requires: fontconfig >= 2.0 Requires: freetype >= 2.1.2 ! Requires: firefox %description *************** *** 74,78 **** License: GPL Requires: %{name}-gtkplug = %{version} ! Requires: mozilla >= 1.6 %description mozilla-plugin VRML browser plug-in for Mozilla-based browsers. --- 74,78 ---- License: GPL Requires: %{name}-gtkplug = %{version} ! Requires: firefox %description mozilla-plugin VRML browser plug-in for Mozilla-based browsers. *************** *** 134,137 **** --- 134,140 ---- %changelog + * Wed Oct 25 2006 Braden McDaniel <br...@en...> + - Require firefox instead of mozilla. + * Thu Oct 05 2006 Braden McDaniel <br...@en...> - Added openvrml-gtkplug info. |
From: Braden M. <br...@us...> - 2006-10-25 19:15:36
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15753/mozilla-plugin Modified Files: configure.ac Log Message: Accommodate building against Firefox development headers. Index: configure.ac =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/configure.ac,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** configure.ac 9 Oct 2006 03:09:56 -0000 1.16 --- configure.ac 25 Oct 2006 19:15:31 -0000 1.17 *************** *** 16,24 **** ACX_PTHREAD(, [AC_MSG_FAILURE([pthread support not found])]) ! PKG_CHECK_MODULES([MOZILLA_PLUGIN], [mozilla-plugin >= 1.6], ! , [have_mozilla_plugin=no]) ! mozversion=`$PKG_CONFIG --modversion mozilla-plugin` ! mozprefix=`$PKG_CONFIG --variable=prefix mozilla-plugin` ! mozlibdir=`$PKG_CONFIG --variable=libdir mozilla-plugin` AC_SUBST([mozlibdir]) PKG_CHECK_MODULES([GTK], [gtk+-2.0], , [have_gtk=no]) --- 16,29 ---- ACX_PTHREAD(, [AC_MSG_FAILURE([pthread support not found])]) ! PKG_CHECK_MODULES([MOZILLA_PLUGIN], ! [firefox-plugin], ! [mozilla_plugin_pkg=firefox-plugin], ! [PKG_CHECK_MODULES([MOZILLA_PLUGIN], ! [mozilla-plugin >= 1.6], ! [mozilla_plugin_pkg=mozilla-plugin], ! [have_mozilla_plugin=no])]) ! mozversion=`$PKG_CONFIG --modversion $mozilla_plugin_pkg` ! mozprefix=`$PKG_CONFIG --variable=prefix $mozilla_plugin_pkg` ! mozlibdir=`$PKG_CONFIG --variable=libdir $mozilla_plugin_pkg` AC_SUBST([mozlibdir]) PKG_CHECK_MODULES([GTK], [gtk+-2.0], , [have_gtk=no]) |
From: Braden M. <br...@us...> - 2006-10-25 19:15:25
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15715/mozilla-plugin Modified Files: Tag: OpenVRML-0_16-BRANCH configure.ac Log Message: Accommodate building against Firefox development headers. Index: configure.ac =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/configure.ac,v retrieving revision 1.14.2.2 retrieving revision 1.14.2.3 diff -C2 -d -r1.14.2.2 -r1.14.2.3 *** configure.ac 9 Oct 2006 03:09:02 -0000 1.14.2.2 --- configure.ac 25 Oct 2006 19:15:17 -0000 1.14.2.3 *************** *** 16,24 **** ACX_PTHREAD(, [AC_MSG_FAILURE([pthread support not found])]) ! PKG_CHECK_MODULES([MOZILLA_PLUGIN], [mozilla-plugin >= 1.6], ! , [have_mozilla_plugin=no]) ! mozversion=`$PKG_CONFIG --modversion mozilla-plugin` ! mozprefix=`$PKG_CONFIG --variable=prefix mozilla-plugin` ! mozlibdir=`$PKG_CONFIG --variable=libdir mozilla-plugin` AC_SUBST([mozlibdir]) PKG_CHECK_MODULES([GTK], [gtk+-2.0], , [have_gtk=no]) --- 16,29 ---- ACX_PTHREAD(, [AC_MSG_FAILURE([pthread support not found])]) ! PKG_CHECK_MODULES([MOZILLA_PLUGIN], ! [firefox-plugin], ! [mozilla_plugin_pkg=firefox-plugin], ! [PKG_CHECK_MODULES([MOZILLA_PLUGIN], ! [mozilla-plugin >= 1.6], ! [mozilla_plugin_pkg=mozilla-plugin], ! [have_mozilla_plugin=no])]) ! mozversion=`$PKG_CONFIG --modversion $mozilla_plugin_pkg` ! mozprefix=`$PKG_CONFIG --variable=prefix $mozilla_plugin_pkg` ! mozlibdir=`$PKG_CONFIG --variable=libdir $mozilla_plugin_pkg` AC_SUBST([mozlibdir]) PKG_CHECK_MODULES([GTK], [gtk+-2.0], , [have_gtk=no]) |
From: Braden M. <br...@us...> - 2006-10-25 19:15:22
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15715 Modified Files: Tag: OpenVRML-0_16-BRANCH configure.ac openvrml.spec.in Log Message: Accommodate building against Firefox development headers. Index: configure.ac =================================================================== RCS file: /cvsroot/openvrml/openvrml/configure.ac,v retrieving revision 1.92.2.5 retrieving revision 1.92.2.6 diff -C2 -d -r1.92.2.5 -r1.92.2.6 *** configure.ac 9 Oct 2006 18:42:53 -0000 1.92.2.5 --- configure.ac 25 Oct 2006 19:15:17 -0000 1.92.2.6 *************** *** 37,40 **** --- 37,41 ---- # REQUIRE_FONTCONFIG="fontconfig" + REQUIRE_FIREFOX_JS="firefox-js" REQUIRE_MOZILLA_JS="mozilla-js >= 1.2.1" *************** *** 106,110 **** ! PKG_CHECK_MODULES([JS], [$REQUIRE_MOZILLA_JS], , [have_js=no]) PKG_CHECK_MODULES([GTK], [gtk+-2.0], , [have_gtk=no]) AC_PATH_XTRA --- 107,115 ---- ! PKG_CHECK_MODULES([JS], [$REQUIRE_FIREFOX_JS], ! [mozilla_js_pkg=$REQUIRE_FIREFOX_JS], ! [PKG_CHECK_MODULES([JS], [$REQUIRE_MOZILLA_JS], ! [mozilla_js_pkg=$REQUIRE_MOZILLA_JS], ! [have_js=no])]) PKG_CHECK_MODULES([GTK], [gtk+-2.0], , [have_gtk=no]) AC_PATH_XTRA *************** *** 226,233 **** OPENVRML_PKG_REQUIRES="${OPENVRML_PKG_REQUIRES}," fi ! OPENVRML_PKG_REQUIRES="${OPENVRML_PKG_REQUIRES} ${REQUIRE_MOZILLA_JS}" AC_DEFINE([OPENVRML_ENABLE_SCRIPT_NODE_JAVASCRIPT], [1], [Defined if Script node JavaScript support is enabled.]) ! GRE_PATH=`$PKG_CONFIG --libs-only-L mozilla-js | sed -e 's/^-L//' -e 's/ *$//'` if test -n "${openvrml_run_path}" -a -n "${GRE_PATH}"; then openvrml_run_path=":${openvrml_run_path}" --- 231,238 ---- OPENVRML_PKG_REQUIRES="${OPENVRML_PKG_REQUIRES}," fi ! OPENVRML_PKG_REQUIRES="${OPENVRML_PKG_REQUIRES} ${mozilla_js_pkg}" AC_DEFINE([OPENVRML_ENABLE_SCRIPT_NODE_JAVASCRIPT], [1], [Defined if Script node JavaScript support is enabled.]) ! GRE_PATH=`$PKG_CONFIG --libs-only-L ${mozilla_js_pkg%% *} | sed -e 's/^-L//' -e 's/ *$//'` if test -n "${openvrml_run_path}" -a -n "${GRE_PATH}"; then openvrml_run_path=":${openvrml_run_path}" Index: openvrml.spec.in =================================================================== RCS file: /cvsroot/openvrml/openvrml/openvrml.spec.in,v retrieving revision 1.52.2.3 retrieving revision 1.52.2.4 diff -C2 -d -r1.52.2.3 -r1.52.2.4 *** openvrml.spec.in 5 Oct 2006 05:14:03 -0000 1.52.2.3 --- openvrml.spec.in 25 Oct 2006 19:15:17 -0000 1.52.2.4 *************** *** 17,21 **** BuildRequires: fontconfig-devel >= 2.0 BuildRequires: freetype-devel >= 2.1.2 ! BuildRequires: mozilla-devel >= 1.6 BuildRequires: mesa-libGLU-devel BuildRequires: libXmu-devel --- 17,21 ---- BuildRequires: fontconfig-devel >= 2.0 BuildRequires: freetype-devel >= 2.1.2 ! BuildRequires: firefox-devel BuildRequires: mesa-libGLU-devel BuildRequires: libXmu-devel *************** *** 26,30 **** Requires: fontconfig >= 2.0 Requires: freetype >= 2.1.2 ! Requires: mozilla >= 1.6 %description --- 26,30 ---- Requires: fontconfig >= 2.0 Requires: freetype >= 2.1.2 ! Requires: firefox %description *************** *** 74,78 **** License: GPL Requires: %{name}-gtkplug = %{version} ! Requires: mozilla >= 1.6 %description mozilla-plugin VRML browser plug-in for Mozilla-based browsers. --- 74,78 ---- License: GPL Requires: %{name}-gtkplug = %{version} ! Requires: firefox %description mozilla-plugin VRML browser plug-in for Mozilla-based browsers. *************** *** 134,137 **** --- 134,140 ---- %changelog + * Wed Oct 25 2006 Braden McDaniel <br...@en...> + - Require firefox instead of mozilla. + * Thu Oct 05 2006 Braden McDaniel <br...@en...> - Added openvrml-gtkplug info. |
From: Braden M. <br...@us...> - 2006-10-23 06:39:33
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31812/src/libopenvrml/openvrml Modified Files: browser.cpp node.cpp Log Message: Moved the URI grammar to private.h so that it can be used by multiple implementation files. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.192 retrieving revision 1.193 diff -C2 -d -r1.192 -r1.193 *** browser.cpp 31 Aug 2006 06:45:30 -0000 1.192 --- browser.cpp 23 Oct 2006 06:39:28 -0000 1.193 *************** *** 42,47 **** # include <boost/mpl/for_each.hpp> # include <boost/ptr_container/ptr_map.hpp> - # include <boost/spirit.hpp> - # include <boost/spirit/phoenix.hpp> # include <boost/thread/thread.hpp> # include <boost/utility.hpp> --- 42,45 ---- *************** *** 2845,3445 **** - template <typename SpiritActor, typename Iterator1, typename Iterator2> - class assign_iterators_base { - SpiritActor actor_; - Iterator1 begin_; - Iterator2 end_; - - public: - typedef assign_iterators_base<SpiritActor, Iterator1, Iterator2> - this_type; - - assign_iterators_base(const SpiritActor & actor, - const Iterator1 & begin, - const Iterator2 & end): - actor_(actor), - begin_(begin), - end_(end) - {} - - template <typename T> - struct result { - typedef void type; - }; - - template <typename Tuple> - typename phoenix::actor_result<this_type, Tuple>::type - eval(Tuple) const - { - this->actor_(this->begin_(), this->end_()); - } - }; - - template <typename SpiritActor, typename Iterator1, typename Iterator2> - phoenix::actor<assign_iterators_base<SpiritActor, Iterator1, Iterator2> > - assign_iterators(const SpiritActor & actor, - const Iterator1 & begin, - const Iterator2 & end) - { - return assign_iterators_base<SpiritActor, Iterator1, Iterator2>(actor, - begin, - end); - } - - class OPENVRML_LOCAL null_actions { - public: - struct null_action { - template <typename Iterator> - void operator()(const Iterator &, const Iterator &) const - {} - }; - - null_action scheme, scheme_specific_part, userinfo, host, port, - authority, path, query, fragment; - }; - - - struct OPENVRML_LOCAL uri_reserved_parser : - public boost::spirit::char_parser<uri_reserved_parser> { - - typedef uri_reserved_parser self_t; - - template <typename CharT> - bool test(CharT ch) const - { - return ch == ';' - || ch == '/' - || ch == '?' - || ch == ':' - || ch == '@' - || ch == '&' - || ch == '=' - || ch == '+' - || ch == '$' - || ch == ','; - } - }; - - const uri_reserved_parser uri_reserved_p = uri_reserved_parser(); - - - struct OPENVRML_LOCAL uri_unreserved_parser : - public boost::spirit::char_parser<uri_unreserved_parser> { - - typedef uri_unreserved_parser self_t; - - template <typename CharT> - bool test(CharT ch) const - { - using namespace std; - return isalnum(char_traits<CharT>::to_int_type(ch)) - || ch == '-' - || ch == '_' - || ch == '.' - || ch == '!' - || ch == '~' - || ch == '*' - || ch == '\'' - || ch == '(' - || ch == ')'; - } - }; - - const uri_unreserved_parser uri_unreserved_p = uri_unreserved_parser(); - - - struct OPENVRML_LOCAL uric_grammar : - public boost::spirit::grammar<uric_grammar> { - - template <typename ScannerT> - struct definition { - typedef boost::spirit::rule<ScannerT> rule_type; - - rule_type uric, escaped; - - definition(const uric_grammar & self); - - const boost::spirit::rule<ScannerT> & start() const; - }; - }; - - template <typename ScannerT> - uric_grammar::definition<ScannerT>::definition(const uric_grammar &) - { - using namespace boost::spirit; - - uric - = uri_reserved_p - | uri_unreserved_p - | escaped - ; - - escaped - = '%' >> xdigit_p >> xdigit_p - ; - } - - template <typename ScannerT> - const boost::spirit::rule<ScannerT> & - uric_grammar::definition<ScannerT>::start() const - { - return this->uric; - } - - - template <typename Actions = null_actions> - struct uri_authority_grammar : - public boost::spirit::grammar<uri_authority_grammar<Actions> > { - - template <typename ScannerT> - struct definition { - struct server_closure : - boost::spirit::closure<server_closure, - typename ScannerT::iterator_t, - typename ScannerT::iterator_t> { - typename server_closure::member1 userinfo_begin; - typename server_closure::member2 userinfo_end; - }; - - typedef boost::spirit::rule<ScannerT> rule_type; - typedef boost::spirit::rule<ScannerT, - typename server_closure::context_t> - server_rule_type; - - rule_type authority; - rule_type reg_name; - server_rule_type server; - rule_type userinfo; - rule_type hostport; - rule_type host; - rule_type hostname; - rule_type domainlabel; - rule_type toplabel; - rule_type ipv4address; - rule_type port; - rule_type escaped; - - explicit definition(const uri_authority_grammar & self); - - const boost::spirit::rule<ScannerT> & start() const; - }; - - const Actions & actions; - - explicit uri_authority_grammar(const Actions & actions = Actions()); - }; - - template <typename Actions> - template <typename ScannerT> - uri_authority_grammar<Actions>::definition<ScannerT>:: - definition(const uri_authority_grammar & self) - { - using namespace boost::spirit; - using namespace phoenix; - - authority - = (server | reg_name)[ self.actions.authority ] - ; - - reg_name - = +( uri_unreserved_p - | escaped - | '$' - | ',' - | ';' - | ':' - | '@' - | '&' - | '=' - | '+' - ) - ; - - server - = !( - !( - userinfo[ - server.userinfo_begin = arg1, - server.userinfo_end = arg2 - ] >> '@' - )[ - assign_iterators(self.actions.userinfo, - server.userinfo_begin, - server.userinfo_end) - ] - >> hostport - ) - ; - - userinfo - = *( uri_unreserved_p - | escaped - | ';' - | ':' - | '&' - | '=' - | '+' - | '$' - | ',' - ) - ; - - hostport - = host >> !(':' >> port) - ; - - host - = (hostname | ipv4address)[ self.actions.host ] - ; - - hostname - = *(domainlabel >> '.') >> toplabel >> !ch_p('.') - ; - - domainlabel - = alnum_p >> *(*ch_p('-') >> alnum_p) - ; - - toplabel - = alpha_p >> *(*ch_p('-') >> alnum_p) - ; - - ipv4address - = +digit_p >> '.' >> +digit_p >> '.' >> +digit_p >> '.' - >> +digit_p - ; - - port - = (*digit_p)[ self.actions.port ] - ; - - escaped - = '%' >> xdigit_p >> xdigit_p - ; - } - - template <typename Actions> - template <typename ScannerT> - const boost::spirit::rule<ScannerT> & - uri_authority_grammar<Actions>::definition<ScannerT>::start() const - { - return this->authority; - } - - template <typename Actions> - uri_authority_grammar<Actions>:: - uri_authority_grammar(const Actions & actions): - actions(actions) - {} - - template <typename Actions> - struct uri_abs_path_grammar : - public boost::spirit::grammar<uri_abs_path_grammar<Actions> > { - - template <typename ScannerT> - struct definition { - typedef boost::spirit::rule<ScannerT> rule_type; - - rule_type abs_path; - rule_type path_segments; - rule_type segment; - rule_type param; - rule_type pchar; - rule_type query; - rule_type escaped; - - explicit definition(const uri_abs_path_grammar & self); - - const boost::spirit::rule<ScannerT> & start() const; - }; - - const Actions & actions; - - explicit uri_abs_path_grammar(const Actions & actions = Actions()); - }; - - template <typename Actions> - template <typename ScannerT> - uri_abs_path_grammar<Actions>::definition<ScannerT>:: - definition(const uri_abs_path_grammar & self) - { - using namespace boost::spirit; - using namespace phoenix; - - abs_path - = ('/' >> path_segments)[ self.actions.path ] - ; - - path_segments - = segment >> *('/' >> segment) - ; - - segment - = *pchar >> *(';' >> param) - ; - - param - = *pchar - ; - - pchar - = uri_unreserved_p - | escaped - | ':' - | '@' - | '&' - | '=' - | '+' - | '$' - | ',' - ; - - escaped - = '%' >> xdigit_p >> xdigit_p - ; - } - - template <typename Actions> - template <typename ScannerT> - const boost::spirit::rule<ScannerT> & - uri_abs_path_grammar<Actions>::definition<ScannerT>::start() const - { - return this->abs_path; - } - - template <typename Actions> - uri_abs_path_grammar<Actions>:: - uri_abs_path_grammar(const Actions & actions): - actions(actions) - {} - - - template <typename Actions = null_actions> - struct absolute_uri_grammar : - public boost::spirit::grammar<absolute_uri_grammar<Actions> > { - - template <typename ScannerT> - struct definition { - struct absolute_uri_closure : - boost::spirit::closure<absolute_uri_closure, - typename ScannerT::iterator_t, - typename ScannerT::iterator_t> { - typename absolute_uri_closure::member1 scheme_begin; - typename absolute_uri_closure::member2 scheme_end; - }; - - struct server_closure : - boost::spirit::closure<server_closure, - typename ScannerT::iterator_t, - typename ScannerT::iterator_t> { - typename server_closure::member1 userinfo_begin; - typename server_closure::member2 userinfo_end; - }; - - typedef boost::spirit::rule<ScannerT> rule_type; - typedef boost::spirit::rule< - ScannerT, - typename absolute_uri_closure::context_t> - absolute_uri_rule_type; - typedef boost::spirit::rule<ScannerT, - typename server_closure::context_t> - server_rule_type; - - absolute_uri_rule_type absolute_uri; - rule_type scheme; - rule_type hier_part; - rule_type opaque_part; - rule_type net_path; - uri_abs_path_grammar<Actions> abs_path; - uri_authority_grammar<Actions> authority; - rule_type query; - rule_type uric_no_slash; - uric_grammar uric; - - explicit definition(const absolute_uri_grammar & self); - - const absolute_uri_rule_type & start() const; - }; - - const Actions & actions; - - explicit absolute_uri_grammar(const Actions & actions = Actions()); - }; - - template <typename Actions> - template <typename ScannerT> - absolute_uri_grammar<Actions>::definition<ScannerT>:: - definition(const absolute_uri_grammar & self): - abs_path(self.actions), - authority(self.actions) - { - using namespace boost::spirit; - using namespace phoenix; - - absolute_uri - = ( - scheme[ - absolute_uri.scheme_begin = arg1, - absolute_uri.scheme_end = arg2 - ] >> ':' - )[ - assign_iterators(self.actions.scheme, - absolute_uri.scheme_begin, - absolute_uri.scheme_end) - ] >> (hier_part | opaque_part)[ - self.actions.scheme_specific_part - ] - ; - - scheme - = (alpha_p >> *(alpha_p | digit_p | '+' | '-' | '.')) - ; - - hier_part - = (net_path | abs_path) >> !('?' >> query) - ; - - opaque_part - = uric_no_slash >> *uric - ; - - uric_no_slash - = uric - '/' - ; - - net_path - = "//" >> authority >> !abs_path - ; - - query - = (*uric)[ self.actions.query ] - ; - - } - - template <typename Actions> - template <typename ScannerT> - const typename absolute_uri_grammar<Actions>:: - template definition<ScannerT>::absolute_uri_rule_type & - absolute_uri_grammar<Actions>::definition<ScannerT>::start() const - { - return this->absolute_uri; - } - - template <typename Actions> - absolute_uri_grammar<Actions>:: - absolute_uri_grammar(const Actions & actions): - actions(actions) - {} - - - template <typename Actions = null_actions> - struct uri_grammar : public boost::spirit::grammar<uri_grammar<Actions> > { - - template <typename ScannerT> - struct definition { - typedef boost::spirit::rule<ScannerT> rule_type; - - rule_type uri_reference; - absolute_uri_grammar<Actions> absolute_uri; - rule_type relative_uri; - rule_type net_path; - uri_abs_path_grammar<Actions> abs_path; - rule_type rel_path; - rule_type rel_segment; - uri_authority_grammar<Actions> authority; - rule_type query; - rule_type fragment; - uric_grammar uric; - rule_type escaped; - - explicit definition(const uri_grammar & self); - - const boost::spirit::rule<ScannerT> & start() const; - }; - - const Actions & actions; - - explicit uri_grammar(const Actions & actions = Actions()); - }; - - - template <typename Actions> - uri_grammar<Actions>::uri_grammar(const Actions & actions): - actions(actions) - {} - - template <typename Actions> - template <typename ScannerT> - uri_grammar<Actions>::definition<ScannerT>:: - definition(const uri_grammar & self): - absolute_uri(self.actions), - abs_path(self.actions), - authority(self.actions) - { - using namespace boost::spirit; - using namespace phoenix; - - BOOST_SPIRIT_DEBUG_NODE(uri_reference); - BOOST_SPIRIT_DEBUG_NODE(absolute_uri); - BOOST_SPIRIT_DEBUG_NODE(net_path); - BOOST_SPIRIT_DEBUG_NODE(abs_path); - BOOST_SPIRIT_DEBUG_NODE(rel_path); - BOOST_SPIRIT_DEBUG_NODE(rel_segment); - BOOST_SPIRIT_DEBUG_NODE(authority); - BOOST_SPIRIT_DEBUG_NODE(query); - BOOST_SPIRIT_DEBUG_NODE(fragment); - BOOST_SPIRIT_DEBUG_NODE(uric); - BOOST_SPIRIT_DEBUG_NODE(escaped); - - uri_reference - = !(absolute_uri | relative_uri) >> !('#' >> fragment) - ; - relative_uri - = (net_path | abs_path | rel_path) >> !('?' >> query) - ; - - net_path - = "//" >> authority >> !abs_path - ; - - rel_path - = (rel_segment >> !abs_path)[ self.actions.path ] - ; - - rel_segment - = +( uri_unreserved_p - | escaped - | ';' - | '@' - | '&' - | '=' - | '+' - | '$' - | ',' - ) - ; - - query - = (*uric)[ self.actions.query ] - ; - - fragment - = (*uric)[ self.actions.fragment ] - ; - - escaped - = '%' >> xdigit_p >> xdigit_p - ; - } - - template <typename Actions> - template <typename ScannerT> - const boost::spirit::rule<ScannerT> & - uri_grammar<Actions>::definition<ScannerT>::start() const - { - return this->uri_reference; - } - class OPENVRML_LOCAL uri { class actions { --- 2843,2846 ---- *************** *** 3717,3721 **** actions a(*this); ! uri_grammar<actions> g(a); string::const_iterator begin = this->str_.begin(); --- 3118,3122 ---- actions a(*this); ! openvrml_::uri_grammar<actions> g(a); string::const_iterator begin = this->str_.begin(); *************** *** 5504,5672 **** /** - * @class openvrml::node_metatype_id - * - * @brief Identifier for @c node_metatype%s. - * - * @c node_metatype identifiers take the following form: - * - * <pre> - * absolute-uri ['#' proto-id ['#' proto-id [...]]] - * </pre> - * - * A @c node_metatype identifier is basically like an absolute URI; - * except the fragment identifier syntax has been extended to support referring - * to nested @c PROTO%s. - * - * For example, supposing the following VRML world resides at - * <code>%http://example.com/example.wrl</code>: - * - * <pre> - * \#VRML V2.0 utf8 - * - * PROTO Outer [] { - * PROTO Inner [] { Group {} } - * Group {} - * } - * </pre> - * - * The @c node_metatype_id string for @c Outer would be - * <code>%http://example.com/example.wrl\#Outer</code>; and for @c Inner, - * <code>%http://example.com/example.wrl\#Outer\#Inner</code>. - */ - - /** - * @internal - * - * @var std::string openvrml::node_metatype_id::id_ - * - * @brief The identifier string. - */ - - namespace { - - struct OPENVRML_LOCAL node_metatype_id_grammar : - public boost::spirit::grammar<node_metatype_id_grammar> { - - template <typename ScannerT> - struct definition { - typedef boost::spirit::rule<ScannerT> rule_type; - - rule_type node_metatype_id; - absolute_uri_grammar<> absolute_uri; - uric_grammar uric; - - definition(const node_metatype_id_grammar & self); - - const boost::spirit::rule<ScannerT> & start() const; - }; - }; - - template <typename ScannerT> - node_metatype_id_grammar::definition<ScannerT>:: - definition(const node_metatype_id_grammar &) - { - node_metatype_id - = absolute_uri >> *('#' >> *uric) - ; - } - - template <typename ScannerT> - const boost::spirit::rule<ScannerT> & - node_metatype_id_grammar::definition<ScannerT>::start() const - { - return this->node_metatype_id; - } - } - - /** - * @brief Construct from a <code>const char *</code>. - * - * @param[in] id the identifier. - * - * @exception std::invalid_argument if @p id is not a valid - * @c node_metatype identifier. - * @exception std::bad_alloc if memory allocation fails. - * - * @todo Need to make sure the fragment part is valid. - */ - openvrml::node_metatype_id::node_metatype_id(const char * id) - OPENVRML_THROW2(std::invalid_argument, std::bad_alloc): - id_(id) - { - using namespace boost::spirit; - - node_metatype_id_grammar g; - if (!parse(this->id_.begin(), this->id_.end(), g, space_p).full) { - throw std::invalid_argument('<' + this->id_ + "> is not a valid " - "node_metatype identifier"); - } - } - - /** - * @brief Construct from a @c std::string. - * - * @param[in] id the identifier. - * - * @exception std::invalid_argument if @p id is not a valid - * @c node_metatype identifier. - * @exception std::bad_alloc if memory allocation fails. - * - * @todo Need to make sure the fragment part is valid. - */ - openvrml::node_metatype_id::node_metatype_id(const std::string & id) - OPENVRML_THROW2(std::invalid_argument, std::bad_alloc): - id_(id) - { - using namespace boost::spirit; - - node_metatype_id_grammar g; - if (!parse(this->id_.begin(), this->id_.end(), g, space_p).full) { - throw std::invalid_argument('<' + this->id_ + "> is not a valid " - "node_metatype identifier"); - } - } - - /** - * @brief Convert to a @c std::string. - * - * @return the @c node_metatype identifier as a @c std::string. - */ - openvrml::node_metatype_id::operator std::string() const - { - return this->id_; - } - - /** - * @relates openvrml::node_metatype_id - * - * @param[in] lhs - * @param[in] rhs - * - * @return @c true if @p lhs and @p rhs are equal, @c false otherwise. - */ - bool openvrml::operator==(const node_metatype_id & lhs, - const node_metatype_id & rhs) - OPENVRML_NOTHROW - { - return lhs.id_ == rhs.id_; - } - - /** - * @relates openvrml::node_metatype_id - * - * @param[in] lhs - * @param[in] rhs - * - * @return @c true if @p lhs and @p rhs are not equal, @c false otherwise. - */ - bool openvrml::operator!=(const node_metatype_id & lhs, - const node_metatype_id & rhs) - OPENVRML_NOTHROW - { - return !(lhs == rhs); - } - - - /** * @class openvrml::browser * --- 4905,4908 ---- Index: node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/node.cpp,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** node.cpp 6 Aug 2006 06:45:24 -0000 1.88 --- node.cpp 23 Oct 2006 06:39:28 -0000 1.89 *************** *** 541,544 **** --- 541,709 ---- /** + * @class openvrml::node_metatype_id + * + * @brief Identifier for @c node_metatype%s. + * + * @c node_metatype identifiers take the following form: + * + * <pre> + * absolute-uri ['#' proto-id ['#' proto-id [...]]] + * </pre> + * + * A @c node_metatype identifier is basically like an absolute URI; + * except the fragment identifier syntax has been extended to support referring + * to nested @c PROTO%s. + * + * For example, supposing the following VRML world resides at + * <code>%http://example.com/example.wrl</code>: + * + * <pre> + * \#VRML V2.0 utf8 + * + * PROTO Outer [] { + * PROTO Inner [] { Group {} } + * Group {} + * } + * </pre> + * + * The @c node_metatype_id string for @c Outer would be + * <code>%http://example.com/example.wrl\#Outer</code>; and for @c Inner, + * <code>%http://example.com/example.wrl\#Outer\#Inner</code>. + */ + + /** + * @internal + * + * @var std::string openvrml::node_metatype_id::id_ + * + * @brief The identifier string. + */ + + namespace { + + struct OPENVRML_LOCAL node_metatype_id_grammar : + public boost::spirit::grammar<node_metatype_id_grammar> { + + template <typename ScannerT> + struct definition { + typedef boost::spirit::rule<ScannerT> rule_type; + + rule_type node_metatype_id; + openvrml_::absolute_uri_grammar<> absolute_uri; + openvrml_::uric_grammar uric; + + definition(const node_metatype_id_grammar & self); + + const boost::spirit::rule<ScannerT> & start() const; + }; + }; + + template <typename ScannerT> + node_metatype_id_grammar::definition<ScannerT>:: + definition(const node_metatype_id_grammar &) + { + node_metatype_id + = absolute_uri >> *('#' >> *uric) + ; + } + + template <typename ScannerT> + const boost::spirit::rule<ScannerT> & + node_metatype_id_grammar::definition<ScannerT>::start() const + { + return this->node_metatype_id; + } + } + + /** + * @brief Construct from a <code>const char *</code>. + * + * @param[in] id the identifier. + * + * @exception std::invalid_argument if @p id is not a valid + * @c node_metatype identifier. + * @exception std::bad_alloc if memory allocation fails. + * + * @todo Need to make sure the fragment part is valid. + */ + openvrml::node_metatype_id::node_metatype_id(const char * id) + OPENVRML_THROW2(std::invalid_argument, std::bad_alloc): + id_(id) + { + using namespace boost::spirit; + + node_metatype_id_grammar g; + if (!parse(this->id_.begin(), this->id_.end(), g, space_p).full) { + throw std::invalid_argument('<' + this->id_ + "> is not a valid " + "node_metatype identifier"); + } + } + + /** + * @brief Construct from a @c std::string. + * + * @param[in] id the identifier. + * + * @exception std::invalid_argument if @p id is not a valid + * @c node_metatype identifier. + * @exception std::bad_alloc if memory allocation fails. + * + * @todo Need to make sure the fragment part is valid. + */ + openvrml::node_metatype_id::node_metatype_id(const std::string & id) + OPENVRML_THROW2(std::invalid_argument, std::bad_alloc): + id_(id) + { + using namespace boost::spirit; + + node_metatype_id_grammar g; + if (!parse(this->id_.begin(), this->id_.end(), g, space_p).full) { + throw std::invalid_argument('<' + this->id_ + "> is not a valid " + "node_metatype identifier"); + } + } + + /** + * @brief Convert to a @c std::string. + * + * @return the @c node_metatype identifier as a @c std::string. + */ + openvrml::node_metatype_id::operator std::string() const + { + return this->id_; + } + + /** + * @relates openvrml::node_metatype_id + * + * @param[in] lhs + * @param[in] rhs + * + * @return @c true if @p lhs and @p rhs are equal, @c false otherwise. + */ + bool openvrml::operator==(const node_metatype_id & lhs, + const node_metatype_id & rhs) + OPENVRML_NOTHROW + { + return lhs.id_ == rhs.id_; + } + + /** + * @relates openvrml::node_metatype_id + * + * @param[in] lhs + * @param[in] rhs + * + * @return @c true if @p lhs and @p rhs are not equal, @c false otherwise. + */ + bool openvrml::operator!=(const node_metatype_id & lhs, + const node_metatype_id & rhs) + OPENVRML_NOTHROW + { + return !(lhs == rhs); + } + + + /** * @class openvrml::node_metatype * |
From: Braden M. <br...@us...> - 2006-10-23 06:39:32
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31812/src/libopenvrml Modified Files: private.h Log Message: Moved the URI grammar to private.h so that it can be used by multiple implementation files. Index: private.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/private.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** private.h 2 Aug 2006 03:20:02 -0000 1.11 --- private.h 23 Oct 2006 06:39:28 -0000 1.12 *************** *** 25,28 **** --- 25,30 ---- # include <openvrml-common.h> # include <boost/concept_check.hpp> + # include <boost/spirit.hpp> + # include <boost/spirit/phoenix.hpp> # ifndef NDEBUG *************** *** 384,387 **** --- 386,987 ---- openvrml::mfvec3f> field_value_types; + + + template <typename SpiritActor, typename Iterator1, typename Iterator2> + class assign_iterators_base { + SpiritActor actor_; + Iterator1 begin_; + Iterator2 end_; + + public: + typedef assign_iterators_base<SpiritActor, Iterator1, Iterator2> + this_type; + + assign_iterators_base(const SpiritActor & actor, + const Iterator1 & begin, + const Iterator2 & end): + actor_(actor), + begin_(begin), + end_(end) + {} + + template <typename T> + struct result { + typedef void type; + }; + + template <typename Tuple> + typename phoenix::actor_result<this_type, Tuple>::type + eval(Tuple) const + { + this->actor_(this->begin_(), this->end_()); + } + }; + + template <typename SpiritActor, typename Iterator1, typename Iterator2> + phoenix::actor<assign_iterators_base<SpiritActor, Iterator1, Iterator2> > + assign_iterators(const SpiritActor & actor, + const Iterator1 & begin, + const Iterator2 & end) + { + return assign_iterators_base<SpiritActor, Iterator1, Iterator2>(actor, + begin, + end); + } + + class OPENVRML_LOCAL null_actions { + public: + struct null_action { + template <typename Iterator> + void operator()(const Iterator &, const Iterator &) const + {} + }; + + null_action scheme, scheme_specific_part, userinfo, host, port, + authority, path, query, fragment; + }; + + + struct OPENVRML_LOCAL uri_reserved_parser : + public boost::spirit::char_parser<uri_reserved_parser> { + + typedef uri_reserved_parser self_t; + + template <typename CharT> + bool test(CharT ch) const + { + return ch == ';' + || ch == '/' + || ch == '?' + || ch == ':' + || ch == '@' + || ch == '&' + || ch == '=' + || ch == '+' + || ch == '$' + || ch == ','; + } + }; + + const uri_reserved_parser uri_reserved_p = uri_reserved_parser(); + + + struct OPENVRML_LOCAL uri_unreserved_parser : + public boost::spirit::char_parser<uri_unreserved_parser> { + + typedef uri_unreserved_parser self_t; + + template <typename CharT> + bool test(CharT ch) const + { + using namespace std; + return isalnum(char_traits<CharT>::to_int_type(ch)) + || ch == '-' + || ch == '_' + || ch == '.' + || ch == '!' + || ch == '~' + || ch == '*' + || ch == '\'' + || ch == '(' + || ch == ')'; + } + }; + + const uri_unreserved_parser uri_unreserved_p = uri_unreserved_parser(); + + + struct OPENVRML_LOCAL uric_grammar : + public boost::spirit::grammar<uric_grammar> { + + template <typename ScannerT> + struct definition { + typedef boost::spirit::rule<ScannerT> rule_type; + + rule_type uric, escaped; + + definition(const uric_grammar & self); + + const boost::spirit::rule<ScannerT> & start() const; + }; + }; + + template <typename ScannerT> + uric_grammar::definition<ScannerT>::definition(const uric_grammar &) + { + using namespace boost::spirit; + + uric + = uri_reserved_p + | uri_unreserved_p + | escaped + ; + + escaped + = '%' >> xdigit_p >> xdigit_p + ; + } + + template <typename ScannerT> + const boost::spirit::rule<ScannerT> & + uric_grammar::definition<ScannerT>::start() const + { + return this->uric; + } + + + template <typename Actions = null_actions> + struct uri_authority_grammar : + public boost::spirit::grammar<uri_authority_grammar<Actions> > { + + template <typename ScannerT> + struct definition { + struct server_closure : + boost::spirit::closure<server_closure, + typename ScannerT::iterator_t, + typename ScannerT::iterator_t> { + typename server_closure::member1 userinfo_begin; + typename server_closure::member2 userinfo_end; + }; + + typedef boost::spirit::rule<ScannerT> rule_type; + typedef boost::spirit::rule<ScannerT, + typename server_closure::context_t> + server_rule_type; + + rule_type authority; + rule_type reg_name; + server_rule_type server; + rule_type userinfo; + rule_type hostport; + rule_type host; + rule_type hostname; + rule_type domainlabel; + rule_type toplabel; + rule_type ipv4address; + rule_type port; + rule_type escaped; + + explicit definition(const uri_authority_grammar & self); + + const boost::spirit::rule<ScannerT> & start() const; + }; + + const Actions & actions; + + explicit uri_authority_grammar(const Actions & actions = Actions()); + }; + + template <typename Actions> + template <typename ScannerT> + uri_authority_grammar<Actions>::definition<ScannerT>:: + definition(const uri_authority_grammar & self) + { + using namespace boost::spirit; + using namespace phoenix; + + authority + = (server | reg_name)[ self.actions.authority ] + ; + + reg_name + = +( uri_unreserved_p + | escaped + | '$' + | ',' + | ';' + | ':' + | '@' + | '&' + | '=' + | '+' + ) + ; + + server + = !( + !( + userinfo[ + server.userinfo_begin = arg1, + server.userinfo_end = arg2 + ] >> '@' + )[ + assign_iterators(self.actions.userinfo, + server.userinfo_begin, + server.userinfo_end) + ] + >> hostport + ) + ; + + userinfo + = *( uri_unreserved_p + | escaped + | ';' + | ':' + | '&' + | '=' + | '+' + | '$' + | ',' + ) + ; + + hostport + = host >> !(':' >> port) + ; + + host + = (hostname | ipv4address)[ self.actions.host ] + ; + + hostname + = *(domainlabel >> '.') >> toplabel >> !ch_p('.') + ; + + domainlabel + = alnum_p >> *(*ch_p('-') >> alnum_p) + ; + + toplabel + = alpha_p >> *(*ch_p('-') >> alnum_p) + ; + + ipv4address + = +digit_p >> '.' >> +digit_p >> '.' >> +digit_p >> '.' + >> +digit_p + ; + + port + = (*digit_p)[ self.actions.port ] + ; + + escaped + = '%' >> xdigit_p >> xdigit_p + ; + } + + template <typename Actions> + template <typename ScannerT> + const boost::spirit::rule<ScannerT> & + uri_authority_grammar<Actions>::definition<ScannerT>::start() const + { + return this->authority; + } + + template <typename Actions> + uri_authority_grammar<Actions>:: + uri_authority_grammar(const Actions & actions): + actions(actions) + {} + + template <typename Actions> + struct uri_abs_path_grammar : + public boost::spirit::grammar<uri_abs_path_grammar<Actions> > { + + template <typename ScannerT> + struct definition { + typedef boost::spirit::rule<ScannerT> rule_type; + + rule_type abs_path; + rule_type path_segments; + rule_type segment; + rule_type param; + rule_type pchar; + rule_type query; + rule_type escaped; + + explicit definition(const uri_abs_path_grammar & self); + + const boost::spirit::rule<ScannerT> & start() const; + }; + + const Actions & actions; + + explicit uri_abs_path_grammar(const Actions & actions = Actions()); + }; + + template <typename Actions> + template <typename ScannerT> + uri_abs_path_grammar<Actions>::definition<ScannerT>:: + definition(const uri_abs_path_grammar & self) + { + using namespace boost::spirit; + using namespace phoenix; + + abs_path + = ('/' >> path_segments)[ self.actions.path ] + ; + + path_segments + = segment >> *('/' >> segment) + ; + + segment + = *pchar >> *(';' >> param) + ; + + param + = *pchar + ; + + pchar + = uri_unreserved_p + | escaped + | ':' + | '@' + | '&' + | '=' + | '+' + | '$' + | ',' + ; + + escaped + = '%' >> xdigit_p >> xdigit_p + ; + } + + template <typename Actions> + template <typename ScannerT> + const boost::spirit::rule<ScannerT> & + uri_abs_path_grammar<Actions>::definition<ScannerT>::start() const + { + return this->abs_path; + } + + template <typename Actions> + uri_abs_path_grammar<Actions>:: + uri_abs_path_grammar(const Actions & actions): + actions(actions) + {} + + + template <typename Actions = null_actions> + struct absolute_uri_grammar : + public boost::spirit::grammar<absolute_uri_grammar<Actions> > { + + template <typename ScannerT> + struct definition { + struct absolute_uri_closure : + boost::spirit::closure<absolute_uri_closure, + typename ScannerT::iterator_t, + typename ScannerT::iterator_t> { + typename absolute_uri_closure::member1 scheme_begin; + typename absolute_uri_closure::member2 scheme_end; + }; + + struct server_closure : + boost::spirit::closure<server_closure, + typename ScannerT::iterator_t, + typename ScannerT::iterator_t> { + typename server_closure::member1 userinfo_begin; + typename server_closure::member2 userinfo_end; + }; + + typedef boost::spirit::rule<ScannerT> rule_type; + typedef boost::spirit::rule< + ScannerT, + typename absolute_uri_closure::context_t> + absolute_uri_rule_type; + typedef boost::spirit::rule<ScannerT, + typename server_closure::context_t> + server_rule_type; + + absolute_uri_rule_type absolute_uri; + rule_type scheme; + rule_type hier_part; + rule_type opaque_part; + rule_type net_path; + uri_abs_path_grammar<Actions> abs_path; + uri_authority_grammar<Actions> authority; + rule_type query; + rule_type uric_no_slash; + uric_grammar uric; + + explicit definition(const absolute_uri_grammar & self); + + const absolute_uri_rule_type & start() const; + }; + + const Actions & actions; + + explicit absolute_uri_grammar(const Actions & actions = Actions()); + }; + + template <typename Actions> + template <typename ScannerT> + absolute_uri_grammar<Actions>::definition<ScannerT>:: + definition(const absolute_uri_grammar & self): + abs_path(self.actions), + authority(self.actions) + { + using namespace boost::spirit; + using namespace phoenix; + + absolute_uri + = ( + scheme[ + absolute_uri.scheme_begin = arg1, + absolute_uri.scheme_end = arg2 + ] >> ':' + )[ + assign_iterators(self.actions.scheme, + absolute_uri.scheme_begin, + absolute_uri.scheme_end) + ] >> (hier_part | opaque_part)[ + self.actions.scheme_specific_part + ] + ; + + scheme + = (alpha_p >> *(alpha_p | digit_p | '+' | '-' | '.')) + ; + + hier_part + = (net_path | abs_path) >> !('?' >> query) + ; + + opaque_part + = uric_no_slash >> *uric + ; + + uric_no_slash + = uric - '/' + ; + + net_path + = "//" >> authority >> !abs_path + ; + + query + = (*uric)[ self.actions.query ] + ; + + } + + template <typename Actions> + template <typename ScannerT> + const typename absolute_uri_grammar<Actions>:: + template definition<ScannerT>::absolute_uri_rule_type & + absolute_uri_grammar<Actions>::definition<ScannerT>::start() const + { + return this->absolute_uri; + } + + template <typename Actions> + absolute_uri_grammar<Actions>:: + absolute_uri_grammar(const Actions & actions): + actions(actions) + {} + + + template <typename Actions = null_actions> + struct uri_grammar : public boost::spirit::grammar<uri_grammar<Actions> > { + + template <typename ScannerT> + struct definition { + typedef boost::spirit::rule<ScannerT> rule_type; + + rule_type uri_reference; + absolute_uri_grammar<Actions> absolute_uri; + rule_type relative_uri; + rule_type net_path; + uri_abs_path_grammar<Actions> abs_path; + rule_type rel_path; + rule_type rel_segment; + uri_authority_grammar<Actions> authority; + rule_type query; + rule_type fragment; + uric_grammar uric; + rule_type escaped; + + explicit definition(const uri_grammar & self); + + const boost::spirit::rule<ScannerT> & start() const; + }; + + const Actions & actions; + + explicit uri_grammar(const Actions & actions = Actions()); + }; + + + template <typename Actions> + uri_grammar<Actions>::uri_grammar(const Actions & actions): + actions(actions) + {} + + template <typename Actions> + template <typename ScannerT> + uri_grammar<Actions>::definition<ScannerT>:: + definition(const uri_grammar & self): + absolute_uri(self.actions), + abs_path(self.actions), + authority(self.actions) + { + using namespace boost::spirit; + using namespace phoenix; + + BOOST_SPIRIT_DEBUG_NODE(uri_reference); + BOOST_SPIRIT_DEBUG_NODE(absolute_uri); + BOOST_SPIRIT_DEBUG_NODE(net_path); + BOOST_SPIRIT_DEBUG_NODE(abs_path); + BOOST_SPIRIT_DEBUG_NODE(rel_path); + BOOST_SPIRIT_DEBUG_NODE(rel_segment); + BOOST_SPIRIT_DEBUG_NODE(authority); + BOOST_SPIRIT_DEBUG_NODE(query); + BOOST_SPIRIT_DEBUG_NODE(fragment); + BOOST_SPIRIT_DEBUG_NODE(uric); + BOOST_SPIRIT_DEBUG_NODE(escaped); + + uri_reference + = !(absolute_uri | relative_uri) >> !('#' >> fragment) + ; + relative_uri + = (net_path | abs_path | rel_path) >> !('?' >> query) + ; + + net_path + = "//" >> authority >> !abs_path + ; + + rel_path + = (rel_segment >> !abs_path)[ self.actions.path ] + ; + + rel_segment + = +( uri_unreserved_p + | escaped + | ';' + | '@' + | '&' + | '=' + | '+' + | '$' + | ',' + ) + ; + + query + = (*uric)[ self.actions.query ] + ; + + fragment + = (*uric)[ self.actions.fragment ] + ; + + escaped + = '%' >> xdigit_p >> xdigit_p + ; + } + + template <typename Actions> + template <typename ScannerT> + const boost::spirit::rule<ScannerT> & + uri_grammar<Actions>::definition<ScannerT>::start() const + { + return this->uri_reference; + } } } |
From: Braden M. <br...@us...> - 2006-10-23 06:39:32
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31812 Modified Files: ChangeLog Log Message: Moved the URI grammar to private.h so that it can be used by multiple implementation files. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1353 retrieving revision 1.1354 diff -C2 -d -r1.1353 -r1.1354 *** ChangeLog 18 Oct 2006 05:56:58 -0000 1.1353 --- ChangeLog 23 Oct 2006 06:39:28 -0000 1.1354 *************** *** 1,2 **** --- 1,14 ---- + 2006-10-23 Braden McDaniel <br...@en...> + + Moved the URI grammar to private.h so that it can be used by + multiple implementation files. + + * src/libopenvrml/private.h: Moved URI grammar to here. + * src/libopenvrml/openvrml/browser.cpp: Removed URI grammar (moved + to private.h). Removed openvrml::node_metatype_id + implementation (moved to node.cpp). + * src/libopenvrml/openvrml/node.cpp: Moved + openvrml::node_metatype_id implementation to here. + 2006-10-18 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-10-23 06:39:23
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31788/src/libopenvrml/openvrml Modified Files: Tag: OpenVRML-0_16-BRANCH browser.cpp node.cpp Log Message: Moved the URI grammar to private.h so that it can be used by multiple implementation files. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.190.2.1 retrieving revision 1.190.2.2 diff -C2 -d -r1.190.2.1 -r1.190.2.2 *** browser.cpp 18 Aug 2006 20:03:27 -0000 1.190.2.1 --- browser.cpp 23 Oct 2006 06:39:17 -0000 1.190.2.2 *************** *** 42,47 **** # include <boost/mpl/for_each.hpp> # include <boost/ptr_container/ptr_map.hpp> - # include <boost/spirit.hpp> - # include <boost/spirit/phoenix.hpp> # include <boost/thread/thread.hpp> # include <boost/utility.hpp> --- 42,45 ---- *************** *** 2843,3443 **** - template <typename SpiritActor, typename Iterator1, typename Iterator2> - class assign_iterators_base { - SpiritActor actor_; - Iterator1 begin_; - Iterator2 end_; - - public: - typedef assign_iterators_base<SpiritActor, Iterator1, Iterator2> - this_type; - - assign_iterators_base(const SpiritActor & actor, - const Iterator1 & begin, - const Iterator2 & end): - actor_(actor), - begin_(begin), - end_(end) - {} - - template <typename T> - struct result { - typedef void type; - }; - - template <typename Tuple> - typename phoenix::actor_result<this_type, Tuple>::type - eval(Tuple) const - { - this->actor_(this->begin_(), this->end_()); - } - }; - - template <typename SpiritActor, typename Iterator1, typename Iterator2> - phoenix::actor<assign_iterators_base<SpiritActor, Iterator1, Iterator2> > - assign_iterators(const SpiritActor & actor, - const Iterator1 & begin, - const Iterator2 & end) - { - return assign_iterators_base<SpiritActor, Iterator1, Iterator2>(actor, - begin, - end); - } - - class OPENVRML_LOCAL null_actions { - public: - struct null_action { - template <typename Iterator> - void operator()(const Iterator &, const Iterator &) const - {} - }; - - null_action scheme, scheme_specific_part, userinfo, host, port, - authority, path, query, fragment; - }; - - - struct OPENVRML_LOCAL uri_reserved_parser : - public boost::spirit::char_parser<uri_reserved_parser> { - - typedef uri_reserved_parser self_t; - - template <typename CharT> - bool test(CharT ch) const - { - return ch == ';' - || ch == '/' - || ch == '?' - || ch == ':' - || ch == '@' - || ch == '&' - || ch == '=' - || ch == '+' - || ch == '$' - || ch == ','; - } - }; - - const uri_reserved_parser uri_reserved_p = uri_reserved_parser(); - - - struct OPENVRML_LOCAL uri_unreserved_parser : - public boost::spirit::char_parser<uri_unreserved_parser> { - - typedef uri_unreserved_parser self_t; - - template <typename CharT> - bool test(CharT ch) const - { - using namespace std; - return isalnum(char_traits<CharT>::to_int_type(ch)) - || ch == '-' - || ch == '_' - || ch == '.' - || ch == '!' - || ch == '~' - || ch == '*' - || ch == '\'' - || ch == '(' - || ch == ')'; - } - }; - - const uri_unreserved_parser uri_unreserved_p = uri_unreserved_parser(); - - - struct OPENVRML_LOCAL uric_grammar : - public boost::spirit::grammar<uric_grammar> { - - template <typename ScannerT> - struct definition { - typedef boost::spirit::rule<ScannerT> rule_type; - - rule_type uric, escaped; - - definition(const uric_grammar & self); - - const boost::spirit::rule<ScannerT> & start() const; - }; - }; - - template <typename ScannerT> - uric_grammar::definition<ScannerT>::definition(const uric_grammar &) - { - using namespace boost::spirit; - - uric - = uri_reserved_p - | uri_unreserved_p - | escaped - ; - - escaped - = '%' >> xdigit_p >> xdigit_p - ; - } - - template <typename ScannerT> - const boost::spirit::rule<ScannerT> & - uric_grammar::definition<ScannerT>::start() const - { - return this->uric; - } - - - template <typename Actions = null_actions> - struct uri_authority_grammar : - public boost::spirit::grammar<uri_authority_grammar<Actions> > { - - template <typename ScannerT> - struct definition { - struct server_closure : - boost::spirit::closure<server_closure, - typename ScannerT::iterator_t, - typename ScannerT::iterator_t> { - typename server_closure::member1 userinfo_begin; - typename server_closure::member2 userinfo_end; - }; - - typedef boost::spirit::rule<ScannerT> rule_type; - typedef boost::spirit::rule<ScannerT, - typename server_closure::context_t> - server_rule_type; - - rule_type authority; - rule_type reg_name; - server_rule_type server; - rule_type userinfo; - rule_type hostport; - rule_type host; - rule_type hostname; - rule_type domainlabel; - rule_type toplabel; - rule_type ipv4address; - rule_type port; - rule_type escaped; - - explicit definition(const uri_authority_grammar & self); - - const boost::spirit::rule<ScannerT> & start() const; - }; - - const Actions & actions; - - explicit uri_authority_grammar(const Actions & actions = Actions()); - }; - - template <typename Actions> - template <typename ScannerT> - uri_authority_grammar<Actions>::definition<ScannerT>:: - definition(const uri_authority_grammar & self) - { - using namespace boost::spirit; - using namespace phoenix; - - authority - = (server | reg_name)[ self.actions.authority ] - ; - - reg_name - = +( uri_unreserved_p - | escaped - | '$' - | ',' - | ';' - | ':' - | '@' - | '&' - | '=' - | '+' - ) - ; - - server - = !( - !( - userinfo[ - server.userinfo_begin = arg1, - server.userinfo_end = arg2 - ] >> '@' - )[ - assign_iterators(self.actions.userinfo, - server.userinfo_begin, - server.userinfo_end) - ] - >> hostport - ) - ; - - userinfo - = *( uri_unreserved_p - | escaped - | ';' - | ':' - | '&' - | '=' - | '+' - | '$' - | ',' - ) - ; - - hostport - = host >> !(':' >> port) - ; - - host - = (hostname | ipv4address)[ self.actions.host ] - ; - - hostname - = *(domainlabel >> '.') >> toplabel >> !ch_p('.') - ; - - domainlabel - = alnum_p >> *(*ch_p('-') >> alnum_p) - ; - - toplabel - = alpha_p >> *(*ch_p('-') >> alnum_p) - ; - - ipv4address - = +digit_p >> '.' >> +digit_p >> '.' >> +digit_p >> '.' - >> +digit_p - ; - - port - = (*digit_p)[ self.actions.port ] - ; - - escaped - = '%' >> xdigit_p >> xdigit_p - ; - } - - template <typename Actions> - template <typename ScannerT> - const boost::spirit::rule<ScannerT> & - uri_authority_grammar<Actions>::definition<ScannerT>::start() const - { - return this->authority; - } - - template <typename Actions> - uri_authority_grammar<Actions>:: - uri_authority_grammar(const Actions & actions): - actions(actions) - {} - - template <typename Actions> - struct uri_abs_path_grammar : - public boost::spirit::grammar<uri_abs_path_grammar<Actions> > { - - template <typename ScannerT> - struct definition { - typedef boost::spirit::rule<ScannerT> rule_type; - - rule_type abs_path; - rule_type path_segments; - rule_type segment; - rule_type param; - rule_type pchar; - rule_type query; - rule_type escaped; - - explicit definition(const uri_abs_path_grammar & self); - - const boost::spirit::rule<ScannerT> & start() const; - }; - - const Actions & actions; - - explicit uri_abs_path_grammar(const Actions & actions = Actions()); - }; - - template <typename Actions> - template <typename ScannerT> - uri_abs_path_grammar<Actions>::definition<ScannerT>:: - definition(const uri_abs_path_grammar & self) - { - using namespace boost::spirit; - using namespace phoenix; - - abs_path - = ('/' >> path_segments)[ self.actions.path ] - ; - - path_segments - = segment >> *('/' >> segment) - ; - - segment - = *pchar >> *(';' >> param) - ; - - param - = *pchar - ; - - pchar - = uri_unreserved_p - | escaped - | ':' - | '@' - | '&' - | '=' - | '+' - | '$' - | ',' - ; - - escaped - = '%' >> xdigit_p >> xdigit_p - ; - } - - template <typename Actions> - template <typename ScannerT> - const boost::spirit::rule<ScannerT> & - uri_abs_path_grammar<Actions>::definition<ScannerT>::start() const - { - return this->abs_path; - } - - template <typename Actions> - uri_abs_path_grammar<Actions>:: - uri_abs_path_grammar(const Actions & actions): - actions(actions) - {} - - - template <typename Actions = null_actions> - struct absolute_uri_grammar : - public boost::spirit::grammar<absolute_uri_grammar<Actions> > { - - template <typename ScannerT> - struct definition { - struct absolute_uri_closure : - boost::spirit::closure<absolute_uri_closure, - typename ScannerT::iterator_t, - typename ScannerT::iterator_t> { - typename absolute_uri_closure::member1 scheme_begin; - typename absolute_uri_closure::member2 scheme_end; - }; - - struct server_closure : - boost::spirit::closure<server_closure, - typename ScannerT::iterator_t, - typename ScannerT::iterator_t> { - typename server_closure::member1 userinfo_begin; - typename server_closure::member2 userinfo_end; - }; - - typedef boost::spirit::rule<ScannerT> rule_type; - typedef boost::spirit::rule< - ScannerT, - typename absolute_uri_closure::context_t> - absolute_uri_rule_type; - typedef boost::spirit::rule<ScannerT, - typename server_closure::context_t> - server_rule_type; - - absolute_uri_rule_type absolute_uri; - rule_type scheme; - rule_type hier_part; - rule_type opaque_part; - rule_type net_path; - uri_abs_path_grammar<Actions> abs_path; - uri_authority_grammar<Actions> authority; - rule_type query; - rule_type uric_no_slash; - uric_grammar uric; - - explicit definition(const absolute_uri_grammar & self); - - const absolute_uri_rule_type & start() const; - }; - - const Actions & actions; - - explicit absolute_uri_grammar(const Actions & actions = Actions()); - }; - - template <typename Actions> - template <typename ScannerT> - absolute_uri_grammar<Actions>::definition<ScannerT>:: - definition(const absolute_uri_grammar & self): - abs_path(self.actions), - authority(self.actions) - { - using namespace boost::spirit; - using namespace phoenix; - - absolute_uri - = ( - scheme[ - absolute_uri.scheme_begin = arg1, - absolute_uri.scheme_end = arg2 - ] >> ':' - )[ - assign_iterators(self.actions.scheme, - absolute_uri.scheme_begin, - absolute_uri.scheme_end) - ] >> (hier_part | opaque_part)[ - self.actions.scheme_specific_part - ] - ; - - scheme - = (alpha_p >> *(alpha_p | digit_p | '+' | '-' | '.')) - ; - - hier_part - = (net_path | abs_path) >> !('?' >> query) - ; - - opaque_part - = uric_no_slash >> *uric - ; - - uric_no_slash - = uric - '/' - ; - - net_path - = "//" >> authority >> !abs_path - ; - - query - = (*uric)[ self.actions.query ] - ; - - } - - template <typename Actions> - template <typename ScannerT> - const typename absolute_uri_grammar<Actions>:: - template definition<ScannerT>::absolute_uri_rule_type & - absolute_uri_grammar<Actions>::definition<ScannerT>::start() const - { - return this->absolute_uri; - } - - template <typename Actions> - absolute_uri_grammar<Actions>:: - absolute_uri_grammar(const Actions & actions): - actions(actions) - {} - - - template <typename Actions = null_actions> - struct uri_grammar : public boost::spirit::grammar<uri_grammar<Actions> > { - - template <typename ScannerT> - struct definition { - typedef boost::spirit::rule<ScannerT> rule_type; - - rule_type uri_reference; - absolute_uri_grammar<Actions> absolute_uri; - rule_type relative_uri; - rule_type net_path; - uri_abs_path_grammar<Actions> abs_path; - rule_type rel_path; - rule_type rel_segment; - uri_authority_grammar<Actions> authority; - rule_type query; - rule_type fragment; - uric_grammar uric; - rule_type escaped; - - explicit definition(const uri_grammar & self); - - const boost::spirit::rule<ScannerT> & start() const; - }; - - const Actions & actions; - - explicit uri_grammar(const Actions & actions = Actions()); - }; - - - template <typename Actions> - uri_grammar<Actions>::uri_grammar(const Actions & actions): - actions(actions) - {} - - template <typename Actions> - template <typename ScannerT> - uri_grammar<Actions>::definition<ScannerT>:: - definition(const uri_grammar & self): - absolute_uri(self.actions), - abs_path(self.actions), - authority(self.actions) - { - using namespace boost::spirit; - using namespace phoenix; - - BOOST_SPIRIT_DEBUG_NODE(uri_reference); - BOOST_SPIRIT_DEBUG_NODE(absolute_uri); - BOOST_SPIRIT_DEBUG_NODE(net_path); - BOOST_SPIRIT_DEBUG_NODE(abs_path); - BOOST_SPIRIT_DEBUG_NODE(rel_path); - BOOST_SPIRIT_DEBUG_NODE(rel_segment); - BOOST_SPIRIT_DEBUG_NODE(authority); - BOOST_SPIRIT_DEBUG_NODE(query); - BOOST_SPIRIT_DEBUG_NODE(fragment); - BOOST_SPIRIT_DEBUG_NODE(uric); - BOOST_SPIRIT_DEBUG_NODE(escaped); - - uri_reference - = !(absolute_uri | relative_uri) >> !('#' >> fragment) - ; - relative_uri - = (net_path | abs_path | rel_path) >> !('?' >> query) - ; - - net_path - = "//" >> authority >> !abs_path - ; - - rel_path - = (rel_segment >> !abs_path)[ self.actions.path ] - ; - - rel_segment - = +( uri_unreserved_p - | escaped - | ';' - | '@' - | '&' - | '=' - | '+' - | '$' - | ',' - ) - ; - - query - = (*uric)[ self.actions.query ] - ; - - fragment - = (*uric)[ self.actions.fragment ] - ; - - escaped - = '%' >> xdigit_p >> xdigit_p - ; - } - - template <typename Actions> - template <typename ScannerT> - const boost::spirit::rule<ScannerT> & - uri_grammar<Actions>::definition<ScannerT>::start() const - { - return this->uri_reference; - } - class OPENVRML_LOCAL uri { class actions { --- 2841,2844 ---- *************** *** 3715,3719 **** actions a(*this); ! uri_grammar<actions> g(a); string::const_iterator begin = this->str_.begin(); --- 3116,3120 ---- actions a(*this); ! openvrml_::uri_grammar<actions> g(a); string::const_iterator begin = this->str_.begin(); *************** *** 5502,5670 **** /** - * @class openvrml::node_metatype_id - * - * @brief Identifier for @c node_metatype%s. - * - * @c node_metatype identifiers take the following form: - * - * <pre> - * absolute-uri ['#' proto-id ['#' proto-id [...]]] - * </pre> - * - * A @c node_metatype identifier is basically like an absolute URI; - * except the fragment identifier syntax has been extended to support referring - * to nested @c PROTO%s. - * - * For example, supposing the following VRML world resides at - * <code>%http://example.com/example.wrl</code>: - * - * <pre> - * \#VRML V2.0 utf8 - * - * PROTO Outer [] { - * PROTO Inner [] { Group {} } - * Group {} - * } - * </pre> - * - * The @c node_metatype_id string for @c Outer would be - * <code>%http://example.com/example.wrl\#Outer</code>; and for @c Inner, - * <code>%http://example.com/example.wrl\#Outer\#Inner</code>. - */ - - /** - * @internal - * - * @var std::string openvrml::node_metatype_id::id_ - * - * @brief The identifier string. - */ - - namespace { - - struct OPENVRML_LOCAL node_metatype_id_grammar : - public boost::spirit::grammar<node_metatype_id_grammar> { - - template <typename ScannerT> - struct definition { - typedef boost::spirit::rule<ScannerT> rule_type; - - rule_type node_metatype_id; - absolute_uri_grammar<> absolute_uri; - uric_grammar uric; - - definition(const node_metatype_id_grammar & self); - - const boost::spirit::rule<ScannerT> & start() const; - }; - }; - - template <typename ScannerT> - node_metatype_id_grammar::definition<ScannerT>:: - definition(const node_metatype_id_grammar &) - { - node_metatype_id - = absolute_uri >> *('#' >> *uric) - ; - } - - template <typename ScannerT> - const boost::spirit::rule<ScannerT> & - node_metatype_id_grammar::definition<ScannerT>::start() const - { - return this->node_metatype_id; - } - } - - /** - * @brief Construct from a <code>const char *</code>. - * - * @param[in] id the identifier. - * - * @exception std::invalid_argument if @p id is not a valid - * @c node_metatype identifier. - * @exception std::bad_alloc if memory allocation fails. - * - * @todo Need to make sure the fragment part is valid. - */ - openvrml::node_metatype_id::node_metatype_id(const char * id) - OPENVRML_THROW2(std::invalid_argument, std::bad_alloc): - id_(id) - { - using namespace boost::spirit; - - node_metatype_id_grammar g; - if (!parse(this->id_.begin(), this->id_.end(), g, space_p).full) { - throw std::invalid_argument('<' + this->id_ + "> is not a valid " - "node_metatype identifier"); - } - } - - /** - * @brief Construct from a @c std::string. - * - * @param[in] id the identifier. - * - * @exception std::invalid_argument if @p id is not a valid - * @c node_metatype identifier. - * @exception std::bad_alloc if memory allocation fails. - * - * @todo Need to make sure the fragment part is valid. - */ - openvrml::node_metatype_id::node_metatype_id(const std::string & id) - OPENVRML_THROW2(std::invalid_argument, std::bad_alloc): - id_(id) - { - using namespace boost::spirit; - - node_metatype_id_grammar g; - if (!parse(this->id_.begin(), this->id_.end(), g, space_p).full) { - throw std::invalid_argument('<' + this->id_ + "> is not a valid " - "node_metatype identifier"); - } - } - - /** - * @brief Convert to a @c std::string. - * - * @return the @c node_metatype identifier as a @c std::string. - */ - openvrml::node_metatype_id::operator std::string() const - { - return this->id_; - } - - /** - * @relates openvrml::node_metatype_id - * - * @param[in] lhs - * @param[in] rhs - * - * @return @c true if @p lhs and @p rhs are equal, @c false otherwise. - */ - bool openvrml::operator==(const node_metatype_id & lhs, - const node_metatype_id & rhs) - OPENVRML_NOTHROW - { - return lhs.id_ == rhs.id_; - } - - /** - * @relates openvrml::node_metatype_id - * - * @param[in] lhs - * @param[in] rhs - * - * @return @c true if @p lhs and @p rhs are not equal, @c false otherwise. - */ - bool openvrml::operator!=(const node_metatype_id & lhs, - const node_metatype_id & rhs) - OPENVRML_NOTHROW - { - return !(lhs == rhs); - } - - - /** * @class openvrml::browser * --- 4903,4906 ---- Index: node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/node.cpp,v retrieving revision 1.88 retrieving revision 1.88.2.1 diff -C2 -d -r1.88 -r1.88.2.1 *** node.cpp 6 Aug 2006 06:45:24 -0000 1.88 --- node.cpp 23 Oct 2006 06:39:17 -0000 1.88.2.1 *************** *** 541,544 **** --- 541,709 ---- /** + * @class openvrml::node_metatype_id + * + * @brief Identifier for @c node_metatype%s. + * + * @c node_metatype identifiers take the following form: + * + * <pre> + * absolute-uri ['#' proto-id ['#' proto-id [...]]] + * </pre> + * + * A @c node_metatype identifier is basically like an absolute URI; + * except the fragment identifier syntax has been extended to support referring + * to nested @c PROTO%s. + * + * For example, supposing the following VRML world resides at + * <code>%http://example.com/example.wrl</code>: + * + * <pre> + * \#VRML V2.0 utf8 + * + * PROTO Outer [] { + * PROTO Inner [] { Group {} } + * Group {} + * } + * </pre> + * + * The @c node_metatype_id string for @c Outer would be + * <code>%http://example.com/example.wrl\#Outer</code>; and for @c Inner, + * <code>%http://example.com/example.wrl\#Outer\#Inner</code>. + */ + + /** + * @internal + * + * @var std::string openvrml::node_metatype_id::id_ + * + * @brief The identifier string. + */ + + namespace { + + struct OPENVRML_LOCAL node_metatype_id_grammar : + public boost::spirit::grammar<node_metatype_id_grammar> { + + template <typename ScannerT> + struct definition { + typedef boost::spirit::rule<ScannerT> rule_type; + + rule_type node_metatype_id; + openvrml_::absolute_uri_grammar<> absolute_uri; + openvrml_::uric_grammar uric; + + definition(const node_metatype_id_grammar & self); + + const boost::spirit::rule<ScannerT> & start() const; + }; + }; + + template <typename ScannerT> + node_metatype_id_grammar::definition<ScannerT>:: + definition(const node_metatype_id_grammar &) + { + node_metatype_id + = absolute_uri >> *('#' >> *uric) + ; + } + + template <typename ScannerT> + const boost::spirit::rule<ScannerT> & + node_metatype_id_grammar::definition<ScannerT>::start() const + { + return this->node_metatype_id; + } + } + + /** + * @brief Construct from a <code>const char *</code>. + * + * @param[in] id the identifier. + * + * @exception std::invalid_argument if @p id is not a valid + * @c node_metatype identifier. + * @exception std::bad_alloc if memory allocation fails. + * + * @todo Need to make sure the fragment part is valid. + */ + openvrml::node_metatype_id::node_metatype_id(const char * id) + OPENVRML_THROW2(std::invalid_argument, std::bad_alloc): + id_(id) + { + using namespace boost::spirit; + + node_metatype_id_grammar g; + if (!parse(this->id_.begin(), this->id_.end(), g, space_p).full) { + throw std::invalid_argument('<' + this->id_ + "> is not a valid " + "node_metatype identifier"); + } + } + + /** + * @brief Construct from a @c std::string. + * + * @param[in] id the identifier. + * + * @exception std::invalid_argument if @p id is not a valid + * @c node_metatype identifier. + * @exception std::bad_alloc if memory allocation fails. + * + * @todo Need to make sure the fragment part is valid. + */ + openvrml::node_metatype_id::node_metatype_id(const std::string & id) + OPENVRML_THROW2(std::invalid_argument, std::bad_alloc): + id_(id) + { + using namespace boost::spirit; + + node_metatype_id_grammar g; + if (!parse(this->id_.begin(), this->id_.end(), g, space_p).full) { + throw std::invalid_argument('<' + this->id_ + "> is not a valid " + "node_metatype identifier"); + } + } + + /** + * @brief Convert to a @c std::string. + * + * @return the @c node_metatype identifier as a @c std::string. + */ + openvrml::node_metatype_id::operator std::string() const + { + return this->id_; + } + + /** + * @relates openvrml::node_metatype_id + * + * @param[in] lhs + * @param[in] rhs + * + * @return @c true if @p lhs and @p rhs are equal, @c false otherwise. + */ + bool openvrml::operator==(const node_metatype_id & lhs, + const node_metatype_id & rhs) + OPENVRML_NOTHROW + { + return lhs.id_ == rhs.id_; + } + + /** + * @relates openvrml::node_metatype_id + * + * @param[in] lhs + * @param[in] rhs + * + * @return @c true if @p lhs and @p rhs are not equal, @c false otherwise. + */ + bool openvrml::operator!=(const node_metatype_id & lhs, + const node_metatype_id & rhs) + OPENVRML_NOTHROW + { + return !(lhs == rhs); + } + + + /** * @class openvrml::node_metatype * |
From: Braden M. <br...@us...> - 2006-10-23 06:39:21
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31788/src/libopenvrml Modified Files: Tag: OpenVRML-0_16-BRANCH private.h Log Message: Moved the URI grammar to private.h so that it can be used by multiple implementation files. Index: private.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/private.h,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** private.h 2 Aug 2006 03:20:02 -0000 1.11 --- private.h 23 Oct 2006 06:39:17 -0000 1.11.2.1 *************** *** 25,28 **** --- 25,30 ---- # include <openvrml-common.h> # include <boost/concept_check.hpp> + # include <boost/spirit.hpp> + # include <boost/spirit/phoenix.hpp> # ifndef NDEBUG *************** *** 384,387 **** --- 386,987 ---- openvrml::mfvec3f> field_value_types; + + + template <typename SpiritActor, typename Iterator1, typename Iterator2> + class assign_iterators_base { + SpiritActor actor_; + Iterator1 begin_; + Iterator2 end_; + + public: + typedef assign_iterators_base<SpiritActor, Iterator1, Iterator2> + this_type; + + assign_iterators_base(const SpiritActor & actor, + const Iterator1 & begin, + const Iterator2 & end): + actor_(actor), + begin_(begin), + end_(end) + {} + + template <typename T> + struct result { + typedef void type; + }; + + template <typename Tuple> + typename phoenix::actor_result<this_type, Tuple>::type + eval(Tuple) const + { + this->actor_(this->begin_(), this->end_()); + } + }; + + template <typename SpiritActor, typename Iterator1, typename Iterator2> + phoenix::actor<assign_iterators_base<SpiritActor, Iterator1, Iterator2> > + assign_iterators(const SpiritActor & actor, + const Iterator1 & begin, + const Iterator2 & end) + { + return assign_iterators_base<SpiritActor, Iterator1, Iterator2>(actor, + begin, + end); + } + + class OPENVRML_LOCAL null_actions { + public: + struct null_action { + template <typename Iterator> + void operator()(const Iterator &, const Iterator &) const + {} + }; + + null_action scheme, scheme_specific_part, userinfo, host, port, + authority, path, query, fragment; + }; + + + struct OPENVRML_LOCAL uri_reserved_parser : + public boost::spirit::char_parser<uri_reserved_parser> { + + typedef uri_reserved_parser self_t; + + template <typename CharT> + bool test(CharT ch) const + { + return ch == ';' + || ch == '/' + || ch == '?' + || ch == ':' + || ch == '@' + || ch == '&' + || ch == '=' + || ch == '+' + || ch == '$' + || ch == ','; + } + }; + + const uri_reserved_parser uri_reserved_p = uri_reserved_parser(); + + + struct OPENVRML_LOCAL uri_unreserved_parser : + public boost::spirit::char_parser<uri_unreserved_parser> { + + typedef uri_unreserved_parser self_t; + + template <typename CharT> + bool test(CharT ch) const + { + using namespace std; + return isalnum(char_traits<CharT>::to_int_type(ch)) + || ch == '-' + || ch == '_' + || ch == '.' + || ch == '!' + || ch == '~' + || ch == '*' + || ch == '\'' + || ch == '(' + || ch == ')'; + } + }; + + const uri_unreserved_parser uri_unreserved_p = uri_unreserved_parser(); + + + struct OPENVRML_LOCAL uric_grammar : + public boost::spirit::grammar<uric_grammar> { + + template <typename ScannerT> + struct definition { + typedef boost::spirit::rule<ScannerT> rule_type; + + rule_type uric, escaped; + + definition(const uric_grammar & self); + + const boost::spirit::rule<ScannerT> & start() const; + }; + }; + + template <typename ScannerT> + uric_grammar::definition<ScannerT>::definition(const uric_grammar &) + { + using namespace boost::spirit; + + uric + = uri_reserved_p + | uri_unreserved_p + | escaped + ; + + escaped + = '%' >> xdigit_p >> xdigit_p + ; + } + + template <typename ScannerT> + const boost::spirit::rule<ScannerT> & + uric_grammar::definition<ScannerT>::start() const + { + return this->uric; + } + + + template <typename Actions = null_actions> + struct uri_authority_grammar : + public boost::spirit::grammar<uri_authority_grammar<Actions> > { + + template <typename ScannerT> + struct definition { + struct server_closure : + boost::spirit::closure<server_closure, + typename ScannerT::iterator_t, + typename ScannerT::iterator_t> { + typename server_closure::member1 userinfo_begin; + typename server_closure::member2 userinfo_end; + }; + + typedef boost::spirit::rule<ScannerT> rule_type; + typedef boost::spirit::rule<ScannerT, + typename server_closure::context_t> + server_rule_type; + + rule_type authority; + rule_type reg_name; + server_rule_type server; + rule_type userinfo; + rule_type hostport; + rule_type host; + rule_type hostname; + rule_type domainlabel; + rule_type toplabel; + rule_type ipv4address; + rule_type port; + rule_type escaped; + + explicit definition(const uri_authority_grammar & self); + + const boost::spirit::rule<ScannerT> & start() const; + }; + + const Actions & actions; + + explicit uri_authority_grammar(const Actions & actions = Actions()); + }; + + template <typename Actions> + template <typename ScannerT> + uri_authority_grammar<Actions>::definition<ScannerT>:: + definition(const uri_authority_grammar & self) + { + using namespace boost::spirit; + using namespace phoenix; + + authority + = (server | reg_name)[ self.actions.authority ] + ; + + reg_name + = +( uri_unreserved_p + | escaped + | '$' + | ',' + | ';' + | ':' + | '@' + | '&' + | '=' + | '+' + ) + ; + + server + = !( + !( + userinfo[ + server.userinfo_begin = arg1, + server.userinfo_end = arg2 + ] >> '@' + )[ + assign_iterators(self.actions.userinfo, + server.userinfo_begin, + server.userinfo_end) + ] + >> hostport + ) + ; + + userinfo + = *( uri_unreserved_p + | escaped + | ';' + | ':' + | '&' + | '=' + | '+' + | '$' + | ',' + ) + ; + + hostport + = host >> !(':' >> port) + ; + + host + = (hostname | ipv4address)[ self.actions.host ] + ; + + hostname + = *(domainlabel >> '.') >> toplabel >> !ch_p('.') + ; + + domainlabel + = alnum_p >> *(*ch_p('-') >> alnum_p) + ; + + toplabel + = alpha_p >> *(*ch_p('-') >> alnum_p) + ; + + ipv4address + = +digit_p >> '.' >> +digit_p >> '.' >> +digit_p >> '.' + >> +digit_p + ; + + port + = (*digit_p)[ self.actions.port ] + ; + + escaped + = '%' >> xdigit_p >> xdigit_p + ; + } + + template <typename Actions> + template <typename ScannerT> + const boost::spirit::rule<ScannerT> & + uri_authority_grammar<Actions>::definition<ScannerT>::start() const + { + return this->authority; + } + + template <typename Actions> + uri_authority_grammar<Actions>:: + uri_authority_grammar(const Actions & actions): + actions(actions) + {} + + template <typename Actions> + struct uri_abs_path_grammar : + public boost::spirit::grammar<uri_abs_path_grammar<Actions> > { + + template <typename ScannerT> + struct definition { + typedef boost::spirit::rule<ScannerT> rule_type; + + rule_type abs_path; + rule_type path_segments; + rule_type segment; + rule_type param; + rule_type pchar; + rule_type query; + rule_type escaped; + + explicit definition(const uri_abs_path_grammar & self); + + const boost::spirit::rule<ScannerT> & start() const; + }; + + const Actions & actions; + + explicit uri_abs_path_grammar(const Actions & actions = Actions()); + }; + + template <typename Actions> + template <typename ScannerT> + uri_abs_path_grammar<Actions>::definition<ScannerT>:: + definition(const uri_abs_path_grammar & self) + { + using namespace boost::spirit; + using namespace phoenix; + + abs_path + = ('/' >> path_segments)[ self.actions.path ] + ; + + path_segments + = segment >> *('/' >> segment) + ; + + segment + = *pchar >> *(';' >> param) + ; + + param + = *pchar + ; + + pchar + = uri_unreserved_p + | escaped + | ':' + | '@' + | '&' + | '=' + | '+' + | '$' + | ',' + ; + + escaped + = '%' >> xdigit_p >> xdigit_p + ; + } + + template <typename Actions> + template <typename ScannerT> + const boost::spirit::rule<ScannerT> & + uri_abs_path_grammar<Actions>::definition<ScannerT>::start() const + { + return this->abs_path; + } + + template <typename Actions> + uri_abs_path_grammar<Actions>:: + uri_abs_path_grammar(const Actions & actions): + actions(actions) + {} + + + template <typename Actions = null_actions> + struct absolute_uri_grammar : + public boost::spirit::grammar<absolute_uri_grammar<Actions> > { + + template <typename ScannerT> + struct definition { + struct absolute_uri_closure : + boost::spirit::closure<absolute_uri_closure, + typename ScannerT::iterator_t, + typename ScannerT::iterator_t> { + typename absolute_uri_closure::member1 scheme_begin; + typename absolute_uri_closure::member2 scheme_end; + }; + + struct server_closure : + boost::spirit::closure<server_closure, + typename ScannerT::iterator_t, + typename ScannerT::iterator_t> { + typename server_closure::member1 userinfo_begin; + typename server_closure::member2 userinfo_end; + }; + + typedef boost::spirit::rule<ScannerT> rule_type; + typedef boost::spirit::rule< + ScannerT, + typename absolute_uri_closure::context_t> + absolute_uri_rule_type; + typedef boost::spirit::rule<ScannerT, + typename server_closure::context_t> + server_rule_type; + + absolute_uri_rule_type absolute_uri; + rule_type scheme; + rule_type hier_part; + rule_type opaque_part; + rule_type net_path; + uri_abs_path_grammar<Actions> abs_path; + uri_authority_grammar<Actions> authority; + rule_type query; + rule_type uric_no_slash; + uric_grammar uric; + + explicit definition(const absolute_uri_grammar & self); + + const absolute_uri_rule_type & start() const; + }; + + const Actions & actions; + + explicit absolute_uri_grammar(const Actions & actions = Actions()); + }; + + template <typename Actions> + template <typename ScannerT> + absolute_uri_grammar<Actions>::definition<ScannerT>:: + definition(const absolute_uri_grammar & self): + abs_path(self.actions), + authority(self.actions) + { + using namespace boost::spirit; + using namespace phoenix; + + absolute_uri + = ( + scheme[ + absolute_uri.scheme_begin = arg1, + absolute_uri.scheme_end = arg2 + ] >> ':' + )[ + assign_iterators(self.actions.scheme, + absolute_uri.scheme_begin, + absolute_uri.scheme_end) + ] >> (hier_part | opaque_part)[ + self.actions.scheme_specific_part + ] + ; + + scheme + = (alpha_p >> *(alpha_p | digit_p | '+' | '-' | '.')) + ; + + hier_part + = (net_path | abs_path) >> !('?' >> query) + ; + + opaque_part + = uric_no_slash >> *uric + ; + + uric_no_slash + = uric - '/' + ; + + net_path + = "//" >> authority >> !abs_path + ; + + query + = (*uric)[ self.actions.query ] + ; + + } + + template <typename Actions> + template <typename ScannerT> + const typename absolute_uri_grammar<Actions>:: + template definition<ScannerT>::absolute_uri_rule_type & + absolute_uri_grammar<Actions>::definition<ScannerT>::start() const + { + return this->absolute_uri; + } + + template <typename Actions> + absolute_uri_grammar<Actions>:: + absolute_uri_grammar(const Actions & actions): + actions(actions) + {} + + + template <typename Actions = null_actions> + struct uri_grammar : public boost::spirit::grammar<uri_grammar<Actions> > { + + template <typename ScannerT> + struct definition { + typedef boost::spirit::rule<ScannerT> rule_type; + + rule_type uri_reference; + absolute_uri_grammar<Actions> absolute_uri; + rule_type relative_uri; + rule_type net_path; + uri_abs_path_grammar<Actions> abs_path; + rule_type rel_path; + rule_type rel_segment; + uri_authority_grammar<Actions> authority; + rule_type query; + rule_type fragment; + uric_grammar uric; + rule_type escaped; + + explicit definition(const uri_grammar & self); + + const boost::spirit::rule<ScannerT> & start() const; + }; + + const Actions & actions; + + explicit uri_grammar(const Actions & actions = Actions()); + }; + + + template <typename Actions> + uri_grammar<Actions>::uri_grammar(const Actions & actions): + actions(actions) + {} + + template <typename Actions> + template <typename ScannerT> + uri_grammar<Actions>::definition<ScannerT>:: + definition(const uri_grammar & self): + absolute_uri(self.actions), + abs_path(self.actions), + authority(self.actions) + { + using namespace boost::spirit; + using namespace phoenix; + + BOOST_SPIRIT_DEBUG_NODE(uri_reference); + BOOST_SPIRIT_DEBUG_NODE(absolute_uri); + BOOST_SPIRIT_DEBUG_NODE(net_path); + BOOST_SPIRIT_DEBUG_NODE(abs_path); + BOOST_SPIRIT_DEBUG_NODE(rel_path); + BOOST_SPIRIT_DEBUG_NODE(rel_segment); + BOOST_SPIRIT_DEBUG_NODE(authority); + BOOST_SPIRIT_DEBUG_NODE(query); + BOOST_SPIRIT_DEBUG_NODE(fragment); + BOOST_SPIRIT_DEBUG_NODE(uric); + BOOST_SPIRIT_DEBUG_NODE(escaped); + + uri_reference + = !(absolute_uri | relative_uri) >> !('#' >> fragment) + ; + relative_uri + = (net_path | abs_path | rel_path) >> !('?' >> query) + ; + + net_path + = "//" >> authority >> !abs_path + ; + + rel_path + = (rel_segment >> !abs_path)[ self.actions.path ] + ; + + rel_segment + = +( uri_unreserved_p + | escaped + | ';' + | '@' + | '&' + | '=' + | '+' + | '$' + | ',' + ) + ; + + query + = (*uric)[ self.actions.query ] + ; + + fragment + = (*uric)[ self.actions.fragment ] + ; + + escaped + = '%' >> xdigit_p >> xdigit_p + ; + } + + template <typename Actions> + template <typename ScannerT> + const boost::spirit::rule<ScannerT> & + uri_grammar<Actions>::definition<ScannerT>::start() const + { + return this->uri_reference; + } } } |
From: Braden M. <br...@us...> - 2006-10-23 06:39:20
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31788 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Moved the URI grammar to private.h so that it can be used by multiple implementation files. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.37 retrieving revision 1.1310.2.38 diff -C2 -d -r1.1310.2.37 -r1.1310.2.38 *** ChangeLog 12 Oct 2006 08:57:04 -0000 1.1310.2.37 --- ChangeLog 23 Oct 2006 06:39:17 -0000 1.1310.2.38 *************** *** 1,2 **** --- 1,14 ---- + 2006-10-23 Braden McDaniel <br...@en...> + + Moved the URI grammar to private.h so that it can be used by + multiple implementation files. + + * src/libopenvrml/private.h: Moved URI grammar to here. + * src/libopenvrml/openvrml/browser.cpp: Removed URI grammar (moved + to private.h). Removed openvrml::node_metatype_id + implementation (moved to node.cpp). + * src/libopenvrml/openvrml/node.cpp: Moved + openvrml::node_metatype_id implementation to here. + 2006-10-12 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-10-18 05:57:02
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14364/src/libopenvrml/openvrml Modified Files: vrml97node.cpp Log Message: Fixed some residual uses of the openvrml::mat4f constructor. Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -d -r1.114 -r1.115 *** vrml97node.cpp 22 Sep 2006 01:06:07 -0000 1.114 --- vrml97node.cpp 18 Oct 2006 05:56:59 -0000 1.115 *************** *** 26882,26886 **** const node_path path = this->scene()->browser().find_node(*this); assert(!path.empty()); ! this->parent_transform = mat4f(); std::for_each(path.begin(), path.end(), accumulate_transform_(this->parent_transform)); --- 26882,26886 ---- const node_path path = this->scene()->browser().find_node(*this); assert(!path.empty()); ! this->parent_transform = make_mat4f(); std::for_each(path.begin(), path.end(), accumulate_transform_(this->parent_transform)); |
From: Braden M. <br...@us...> - 2006-10-18 05:57:01
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14364/src/libopenvrml-gl/openvrml/gl Modified Files: viewer.cpp Log Message: Fixed some residual uses of the openvrml::mat4f constructor. Index: viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl/viewer.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** viewer.cpp 10 Oct 2006 21:50:05 -0000 1.47 --- viewer.cpp 18 Oct 2006 05:56:59 -0000 1.48 *************** *** 1146,1150 **** { assert(this->browser()); ! this->browser()->active_viewpoint().user_view_transform(mat4f()); this->post_redraw(); } --- 1146,1150 ---- { assert(this->browser()); ! this->browser()->active_viewpoint().user_view_transform(make_mat4f()); this->post_redraw(); } |
From: Braden M. <br...@us...> - 2006-10-18 05:57:01
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14364 Modified Files: ChangeLog Log Message: Fixed some residual uses of the openvrml::mat4f constructor. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1352 retrieving revision 1.1353 diff -C2 -d -r1.1352 -r1.1353 *** ChangeLog 12 Oct 2006 08:57:30 -0000 1.1352 --- ChangeLog 18 Oct 2006 05:56:58 -0000 1.1353 *************** *** 1,2 **** --- 1,13 ---- + 2006-10-18 Braden McDaniel <br...@en...> + + Fixed some residual uses of the openvrml::mat4f constructor. + + * src/libopenvrml/openvrml/vrml97node.cpp + (viewpoint_node::do_relocate()): Use make_mat4f instead of mat4f's + default constructor. + * src/libopenvrml-gl/openvrml/gl/viewer.cpp + (openvrml::gl::viewer::reset_user_navigation()): Use make_mat4f + instead of mat4f's default constructor. + 2006-10-12 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-10-12 08:57:33
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19366/mozilla-plugin/src Modified Files: openvrml.cpp Log Message: Throw std::runtime_error in response to failures from GLib functions. Index: openvrml.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** openvrml.cpp 12 Oct 2006 07:39:01 -0000 1.41 --- openvrml.cpp 12 Oct 2006 08:57:30 -0000 1.42 *************** *** 91,95 **** ~plugin_instance() throw (); ! void set_window(NPWindow & window) throw (std::bad_alloc); void HandleEvent(void * event) throw (); ssize_t write_command(const std::string & command); --- 91,96 ---- ~plugin_instance() throw (); ! void set_window(NPWindow & window) ! throw (std::bad_alloc, std::runtime_error); void HandleEvent(void * event) throw (); ssize_t write_command(const std::string & command); *************** *** 417,420 **** --- 418,424 ---- } catch (std::bad_alloc &) { return NPERR_OUT_OF_MEMORY_ERROR; + } catch (std::runtime_error & ex) { + g_critical(ex.what()); + return NPERR_GENERIC_ERROR; } return NPERR_NO_ERROR; *************** *** 1092,1096 **** void plugin_instance::set_window(NPWindow & window) ! throw (std::bad_alloc) { assert(window.window); --- 1096,1100 ---- void plugin_instance::set_window(NPWindow & window) ! throw (std::bad_alloc, std::runtime_error) { assert(window.window); *************** *** 1132,1135 **** --- 1136,1140 ---- } else { GError * error = 0; + scope_guard error_guard = make_guard(g_error_free, error); gboolean succeeded = g_shell_parse_argv(openvrml_gtkplug_cmd, *************** *** 1138,1146 **** &error); if (!succeeded) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } } } --- 1143,1151 ---- &error); if (!succeeded) { ! throw std::runtime_error(error ! ? error->message ! : "g_shell_parse_argv failure"); } + error_guard.dismiss(); } *************** *** 1174,1177 **** --- 1179,1183 ---- gint * const standard_error = 0; GError * error = 0; + scope_guard error_guard = make_guard(g_error_free, error); gboolean succeeded = g_spawn_async_with_pipes(working_dir, argv, *************** *** 1186,1196 **** &error); if (!succeeded) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } ! return; } this->command_channel = g_io_channel_unix_new(standard_input); if (!this->command_channel) { throw std::bad_alloc(); } --- 1192,1204 ---- &error); if (!succeeded) { ! throw std::runtime_error(error ! ? error->message ! : "g_spawn_async_with_pipes failure"); } + // + // Don't dismiss "error_guard" yet; we reuse "error" below. + // + this->command_channel = g_io_channel_unix_new(standard_input); if (!this->command_channel) { throw std::bad_alloc(); } *************** *** 1200,1212 **** &error); if (status != G_IO_STATUS_NORMAL) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } ! // XXX ! // XXX Should probably throw here instead. ! // XXX return; } this->request_channel = g_io_channel_unix_new(standard_output); --- 1208,1217 ---- &error); if (status != G_IO_STATUS_NORMAL) { ! throw std::runtime_error(error ! ? error->message ! : "g_io_channel_set_encoding failure"); return; } + error_guard.dismiss(); this->request_channel = g_io_channel_unix_new(standard_output); |
From: Braden M. <br...@us...> - 2006-10-12 08:57:33
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19366 Modified Files: ChangeLog Log Message: Throw std::runtime_error in response to failures from GLib functions. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1351 retrieving revision 1.1352 diff -C2 -d -r1.1351 -r1.1352 *** ChangeLog 12 Oct 2006 07:39:01 -0000 1.1351 --- ChangeLog 12 Oct 2006 08:57:30 -0000 1.1352 *************** *** 2,5 **** --- 2,12 ---- * mozilla-plugin/src/openvrml.cpp + (NPP_SetWindow(NPP, NPWindow *)): Catch std::runtime_error. + (plugin_instance::set_window(NPWindow &)): Throw + std::runtime_error in response to failures from GLib functions. + + 2006-10-12 Braden McDaniel <br...@en...> + + * mozilla-plugin/src/openvrml.cpp (plugin_instance::set_window(NPWindow &)): Improved exception safety with ScopeGuard. |
From: Braden M. <br...@us...> - 2006-10-12 08:57:09
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19210/mozilla-plugin/src Modified Files: Tag: OpenVRML-0_16-BRANCH openvrml.cpp Log Message: Throw std::runtime_error in response to failures from GLib functions. Index: openvrml.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml.cpp,v retrieving revision 1.37.2.4 retrieving revision 1.37.2.5 diff -C2 -d -r1.37.2.4 -r1.37.2.5 *** openvrml.cpp 12 Oct 2006 07:38:51 -0000 1.37.2.4 --- openvrml.cpp 12 Oct 2006 08:57:05 -0000 1.37.2.5 *************** *** 91,95 **** ~plugin_instance() throw (); ! void set_window(NPWindow & window) throw (std::bad_alloc); void HandleEvent(void * event) throw (); ssize_t write_command(const std::string & command); --- 91,96 ---- ~plugin_instance() throw (); ! void set_window(NPWindow & window) ! throw (std::bad_alloc, std::runtime_error); void HandleEvent(void * event) throw (); ssize_t write_command(const std::string & command); *************** *** 417,420 **** --- 418,424 ---- } catch (std::bad_alloc &) { return NPERR_OUT_OF_MEMORY_ERROR; + } catch (std::runtime_error & ex) { + g_critical(ex.what()); + return NPERR_GENERIC_ERROR; } return NPERR_NO_ERROR; *************** *** 1092,1096 **** void plugin_instance::set_window(NPWindow & window) ! throw (std::bad_alloc) { assert(window.window); --- 1096,1100 ---- void plugin_instance::set_window(NPWindow & window) ! throw (std::bad_alloc, std::runtime_error) { assert(window.window); *************** *** 1132,1135 **** --- 1136,1140 ---- } else { GError * error = 0; + scope_guard error_guard = make_guard(g_error_free, error); gboolean succeeded = g_shell_parse_argv(openvrml_gtkplug_cmd, *************** *** 1138,1146 **** &error); if (!succeeded) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } } } --- 1143,1151 ---- &error); if (!succeeded) { ! throw std::runtime_error(error ! ? error->message ! : "g_shell_parse_argv failure"); } + error_guard.dismiss(); } *************** *** 1174,1177 **** --- 1179,1183 ---- gint * const standard_error = 0; GError * error = 0; + scope_guard error_guard = make_guard(g_error_free, error); gboolean succeeded = g_spawn_async_with_pipes(working_dir, argv, *************** *** 1186,1196 **** &error); if (!succeeded) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } ! return; } this->command_channel = g_io_channel_unix_new(standard_input); if (!this->command_channel) { throw std::bad_alloc(); } --- 1192,1204 ---- &error); if (!succeeded) { ! throw std::runtime_error(error ! ? error->message ! : "g_spawn_async_with_pipes failure"); } + // + // Don't dismiss "error_guard" yet; we reuse "error" below. + // + this->command_channel = g_io_channel_unix_new(standard_input); if (!this->command_channel) { throw std::bad_alloc(); } *************** *** 1200,1212 **** &error); if (status != G_IO_STATUS_NORMAL) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } ! // XXX ! // XXX Should probably throw here instead. ! // XXX return; } this->request_channel = g_io_channel_unix_new(standard_output); --- 1208,1217 ---- &error); if (status != G_IO_STATUS_NORMAL) { ! throw std::runtime_error(error ! ? error->message ! : "g_io_channel_set_encoding failure"); return; } + error_guard.dismiss(); this->request_channel = g_io_channel_unix_new(standard_output); |
From: Braden M. <br...@us...> - 2006-10-12 08:57:08
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19210 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Throw std::runtime_error in response to failures from GLib functions. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.36 retrieving revision 1.1310.2.37 diff -C2 -d -r1.1310.2.36 -r1.1310.2.37 *** ChangeLog 12 Oct 2006 07:38:51 -0000 1.1310.2.36 --- ChangeLog 12 Oct 2006 08:57:04 -0000 1.1310.2.37 *************** *** 2,5 **** --- 2,12 ---- * mozilla-plugin/src/openvrml.cpp + (NPP_SetWindow(NPP, NPWindow *)): Catch std::runtime_error. + (plugin_instance::set_window(NPWindow &)): Throw + std::runtime_error in response to failures from GLib functions. + + 2006-10-12 Braden McDaniel <br...@en...> + + * mozilla-plugin/src/openvrml.cpp (plugin_instance::set_window(NPWindow &)): Improved exception safety with ScopeGuard. |
From: Braden M. <br...@us...> - 2006-10-12 07:39:06
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20060/mozilla-plugin/src Modified Files: openvrml.cpp Log Message: Improved exception safety with ScopeGuard. Index: openvrml.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** openvrml.cpp 9 Oct 2006 03:09:56 -0000 1.40 --- openvrml.cpp 12 Oct 2006 07:39:01 -0000 1.41 *************** *** 26,30 **** --- 26,32 ---- # include <sys/socket.h> # include <sys/wait.h> + # include <boost/concept_check.hpp> # include <boost/lexical_cast.hpp> + # include <boost/multi_index/detail/scope_guard.hpp> # include <boost/noncopyable.hpp> # include <boost/scoped_ptr.hpp> *************** *** 38,41 **** --- 40,45 ---- # endif + using namespace boost::multi_index::detail; // for scope_guard + namespace { *************** *** 1095,1175 **** // The plug-in window is unchanged. Resize the window and exit. // ! } else { ! using std::string; ! using std::vector; ! using boost::lexical_cast; ! ! this->window = GdkNativeWindow(ptrdiff_t(window.window)); ! ! // ! // The OPENVRML_GTKPLUG environment variable overrides the default ! // path to the child process executable. To allow OPENVRML_GTKPLUG ! // to include arguments (rather than just be a path to an ! // executable), it is parsed with g_shell_parse_argv. This is ! // particularly useful in case we want to run the child process in ! // a harness like valgrind. ! // ! gint openvrml_gtkplug_cmd_argc = 0; ! gchar ** openvrml_gtkplug_cmd_argv = 0; ! const gchar * const openvrml_gtkplug_cmd = ! g_getenv("OPENVRML_GTKPLUG"); ! if (!openvrml_gtkplug_cmd) { ! openvrml_gtkplug_cmd_argc = 1; ! openvrml_gtkplug_cmd_argv = ! static_cast<gchar **>(g_malloc0(sizeof (gchar *) * 2)); ! if (!openvrml_gtkplug_cmd_argv) { throw std::bad_alloc(); } ! openvrml_gtkplug_cmd_argv[0] = ! g_strdup(OPENVRML_LIBEXECDIR_ "/openvrml-gtkplug"); ! if (!openvrml_gtkplug_cmd_argv[0]) { throw std::bad_alloc(); } ! } else { ! GError * error = 0; ! gboolean succeeded = ! g_shell_parse_argv(openvrml_gtkplug_cmd, ! &openvrml_gtkplug_cmd_argc, ! &openvrml_gtkplug_cmd_argv, ! &error); ! if (!succeeded) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } ! } ! } ! string socket_id_arg = lexical_cast<string>(this->window); ! const char * socket_id_arg_c_str = socket_id_arg.c_str(); ! vector<char> socket_id_arg_vec( ! socket_id_arg_c_str, ! socket_id_arg_c_str + socket_id_arg.length() + 1); ! const gint argv_size = openvrml_gtkplug_cmd_argc + 2; ! gchar ** const argv = ! static_cast<gchar **>(g_malloc(sizeof (gchar *) * argv_size)); ! if (!argv) { throw std::bad_alloc(); } ! gint i; ! for (i = 0; i < openvrml_gtkplug_cmd_argc; ++i) { ! argv[i] = openvrml_gtkplug_cmd_argv[i]; ! } ! argv[i++] = &socket_id_arg_vec.front(); ! argv[i] = 0; ! gchar * const working_directory = g_get_current_dir(); ! if (!working_directory) { throw std::bad_alloc(); }; ! gchar ** envp = 0; ! GPid * const child_pid = 0; ! gint standard_input, standard_output; ! gint * const standard_error = 0; GError * error = 0; ! gboolean succeeded = g_spawn_async_with_pipes(working_directory, ! argv, ! envp, ! GSpawnFlags(0), ! 0, ! 0, ! child_pid, ! &standard_input, ! &standard_output, ! standard_error, ! &error); if (!succeeded) { if (error) { --- 1099,1140 ---- // The plug-in window is unchanged. Resize the window and exit. // ! return; ! } ! using std::string; ! using std::vector; ! using boost::lexical_cast; ! this->window = GdkNativeWindow(ptrdiff_t(window.window)); ! // ! // The OPENVRML_GTKPLUG environment variable overrides the default ! // path to the child process executable. To allow OPENVRML_GTKPLUG ! // to include arguments (rather than just be a path to an ! // executable), it is parsed with g_shell_parse_argv. This is ! // particularly useful in case we want to run the child process in ! // a harness like valgrind. ! // ! gint openvrml_gtkplug_cmd_argc = 0; ! gchar ** openvrml_gtkplug_cmd_argv = 0; ! scope_guard openvrml_gtkplug_cmd_argv_guard = ! make_guard(g_strfreev, openvrml_gtkplug_cmd_argv); ! const gchar * const openvrml_gtkplug_cmd = ! g_getenv("OPENVRML_GTKPLUG"); ! if (!openvrml_gtkplug_cmd) { ! openvrml_gtkplug_cmd_argc = 1; ! openvrml_gtkplug_cmd_argv = ! static_cast<gchar **>(g_malloc0(sizeof (gchar *) * 2)); ! if (!openvrml_gtkplug_cmd_argv) { throw std::bad_alloc(); } ! openvrml_gtkplug_cmd_argv[0] = ! g_strdup(OPENVRML_LIBEXECDIR_ "/openvrml-gtkplug"); ! if (!openvrml_gtkplug_cmd_argv[0]) { throw std::bad_alloc(); } ! } else { GError * error = 0; ! gboolean succeeded = ! g_shell_parse_argv(openvrml_gtkplug_cmd, ! &openvrml_gtkplug_cmd_argc, ! &openvrml_gtkplug_cmd_argv, ! &error); if (!succeeded) { if (error) { *************** *** 1178,1217 **** } } ! // XXX ! // XXX Not the least bit exception-safe. This needs some ! // XXX ScopeGuard love. ! // XXX ! g_free(working_directory); ! g_free(argv); ! g_strfreev(openvrml_gtkplug_cmd_argv); ! if (succeeded) { ! this->command_channel = g_io_channel_unix_new(standard_input); ! if (!this->command_channel) { throw std::bad_alloc(); } ! const GIOStatus status = ! g_io_channel_set_encoding(this->command_channel, ! 0, // binary (no encoding) ! &error); ! if (status != G_IO_STATUS_NORMAL) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } ! // XXX ! // XXX Should probably throw here instead. ! // XXX ! return; ! } ! this->request_channel = g_io_channel_unix_new(standard_output); ! if (!this->command_channel) { throw std::bad_alloc(); } ! this->request_channel_watch_id = ! g_io_add_watch(this->request_channel, ! G_IO_IN, ! request_data_available, ! this); } } } --- 1143,1220 ---- } } + } ! string socket_id_arg = lexical_cast<string>(this->window); ! const char * socket_id_arg_c_str = socket_id_arg.c_str(); ! vector<char> socket_id_arg_vec( ! socket_id_arg_c_str, ! socket_id_arg_c_str + socket_id_arg.length() + 1); ! const gint argv_size = openvrml_gtkplug_cmd_argc + 2; ! gchar ** const argv = ! static_cast<gchar **>(g_malloc(sizeof (gchar *) * argv_size)); ! if (!argv) { throw std::bad_alloc(); } ! scope_guard argv_guard = make_guard(g_free, argv); ! boost::ignore_unused_variable_warning(argv_guard); ! gint i; ! for (i = 0; i < openvrml_gtkplug_cmd_argc; ++i) { ! argv[i] = openvrml_gtkplug_cmd_argv[i]; ! } ! argv[i++] = &socket_id_arg_vec.front(); ! argv[i] = 0; ! gchar * const working_dir = g_get_current_dir(); ! if (!working_dir) { throw std::bad_alloc(); }; ! scope_guard working_dir_guard = make_guard(g_free, working_dir); ! boost::ignore_unused_variable_warning(working_dir_guard); ! ! gchar ** envp = 0; ! GPid * const child_pid = 0; ! gint standard_input, standard_output; ! gint * const standard_error = 0; ! GError * error = 0; ! gboolean succeeded = g_spawn_async_with_pipes(working_dir, ! argv, ! envp, ! GSpawnFlags(0), ! 0, ! 0, ! child_pid, ! &standard_input, ! &standard_output, ! standard_error, ! &error); ! if (!succeeded) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); } + return; + } + + this->command_channel = g_io_channel_unix_new(standard_input); + if (!this->command_channel) { throw std::bad_alloc(); } + const GIOStatus status = + g_io_channel_set_encoding(this->command_channel, + 0, // binary (no encoding) + &error); + if (status != G_IO_STATUS_NORMAL) { + if (error) { + g_critical(error->message); + g_error_free(error); + } + // XXX + // XXX Should probably throw here instead. + // XXX + return; } + + this->request_channel = g_io_channel_unix_new(standard_output); + if (!this->command_channel) { throw std::bad_alloc(); } + this->request_channel_watch_id = + g_io_add_watch(this->request_channel, + G_IO_IN, + request_data_available, + this); } |
From: Braden M. <br...@us...> - 2006-10-12 07:39:05
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20060 Modified Files: ChangeLog Log Message: Improved exception safety with ScopeGuard. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1350 retrieving revision 1.1351 diff -C2 -d -r1.1350 -r1.1351 *** ChangeLog 10 Oct 2006 22:29:16 -0000 1.1350 --- ChangeLog 12 Oct 2006 07:39:01 -0000 1.1351 *************** *** 1,2 **** --- 1,8 ---- + 2006-10-12 Braden McDaniel <br...@en...> + + * mozilla-plugin/src/openvrml.cpp + (plugin_instance::set_window(NPWindow &)): Improved exception + safety with ScopeGuard. + 2006-10-10 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-10-12 07:38:56
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20043 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Improved exception safety with ScopeGuard. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.35 retrieving revision 1.1310.2.36 diff -C2 -d -r1.1310.2.35 -r1.1310.2.36 *** ChangeLog 10 Oct 2006 22:28:57 -0000 1.1310.2.35 --- ChangeLog 12 Oct 2006 07:38:51 -0000 1.1310.2.36 *************** *** 1,2 **** --- 1,8 ---- + 2006-10-12 Braden McDaniel <br...@en...> + + * mozilla-plugin/src/openvrml.cpp + (plugin_instance::set_window(NPWindow &)): Improved exception + safety with ScopeGuard. + 2006-10-10 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2006-10-12 07:38:54
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20043/mozilla-plugin/src Modified Files: Tag: OpenVRML-0_16-BRANCH openvrml.cpp Log Message: Improved exception safety with ScopeGuard. Index: openvrml.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml.cpp,v retrieving revision 1.37.2.3 retrieving revision 1.37.2.4 diff -C2 -d -r1.37.2.3 -r1.37.2.4 *** openvrml.cpp 9 Oct 2006 03:09:02 -0000 1.37.2.3 --- openvrml.cpp 12 Oct 2006 07:38:51 -0000 1.37.2.4 *************** *** 26,30 **** --- 26,32 ---- # include <sys/socket.h> # include <sys/wait.h> + # include <boost/concept_check.hpp> # include <boost/lexical_cast.hpp> + # include <boost/multi_index/detail/scope_guard.hpp> # include <boost/noncopyable.hpp> # include <boost/scoped_ptr.hpp> *************** *** 38,41 **** --- 40,45 ---- # endif + using namespace boost::multi_index::detail; // for scope_guard + namespace { *************** *** 1095,1175 **** // The plug-in window is unchanged. Resize the window and exit. // ! } else { ! using std::string; ! using std::vector; ! using boost::lexical_cast; ! ! this->window = GdkNativeWindow(ptrdiff_t(window.window)); ! ! // ! // The OPENVRML_GTKPLUG environment variable overrides the default ! // path to the child process executable. To allow OPENVRML_GTKPLUG ! // to include arguments (rather than just be a path to an ! // executable), it is parsed with g_shell_parse_argv. This is ! // particularly useful in case we want to run the child process in ! // a harness like valgrind. ! // ! gint openvrml_gtkplug_cmd_argc = 0; ! gchar ** openvrml_gtkplug_cmd_argv = 0; ! const gchar * const openvrml_gtkplug_cmd = ! g_getenv("OPENVRML_GTKPLUG"); ! if (!openvrml_gtkplug_cmd) { ! openvrml_gtkplug_cmd_argc = 1; ! openvrml_gtkplug_cmd_argv = ! static_cast<gchar **>(g_malloc0(sizeof (gchar *) * 2)); ! if (!openvrml_gtkplug_cmd_argv) { throw std::bad_alloc(); } ! openvrml_gtkplug_cmd_argv[0] = ! g_strdup(OPENVRML_LIBEXECDIR_ "/openvrml-gtkplug"); ! if (!openvrml_gtkplug_cmd_argv[0]) { throw std::bad_alloc(); } ! } else { ! GError * error = 0; ! gboolean succeeded = ! g_shell_parse_argv(openvrml_gtkplug_cmd, ! &openvrml_gtkplug_cmd_argc, ! &openvrml_gtkplug_cmd_argv, ! &error); ! if (!succeeded) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } ! } ! } ! string socket_id_arg = lexical_cast<string>(this->window); ! const char * socket_id_arg_c_str = socket_id_arg.c_str(); ! vector<char> socket_id_arg_vec( ! socket_id_arg_c_str, ! socket_id_arg_c_str + socket_id_arg.length() + 1); ! const gint argv_size = openvrml_gtkplug_cmd_argc + 2; ! gchar ** const argv = ! static_cast<gchar **>(g_malloc(sizeof (gchar *) * argv_size)); ! if (!argv) { throw std::bad_alloc(); } ! gint i; ! for (i = 0; i < openvrml_gtkplug_cmd_argc; ++i) { ! argv[i] = openvrml_gtkplug_cmd_argv[i]; ! } ! argv[i++] = &socket_id_arg_vec.front(); ! argv[i] = 0; ! gchar * const working_directory = g_get_current_dir(); ! if (!working_directory) { throw std::bad_alloc(); }; ! gchar ** envp = 0; ! GPid * const child_pid = 0; ! gint standard_input, standard_output; ! gint * const standard_error = 0; GError * error = 0; ! gboolean succeeded = g_spawn_async_with_pipes(working_directory, ! argv, ! envp, ! GSpawnFlags(0), ! 0, ! 0, ! child_pid, ! &standard_input, ! &standard_output, ! standard_error, ! &error); if (!succeeded) { if (error) { --- 1099,1140 ---- // The plug-in window is unchanged. Resize the window and exit. // ! return; ! } ! using std::string; ! using std::vector; ! using boost::lexical_cast; ! this->window = GdkNativeWindow(ptrdiff_t(window.window)); ! // ! // The OPENVRML_GTKPLUG environment variable overrides the default ! // path to the child process executable. To allow OPENVRML_GTKPLUG ! // to include arguments (rather than just be a path to an ! // executable), it is parsed with g_shell_parse_argv. This is ! // particularly useful in case we want to run the child process in ! // a harness like valgrind. ! // ! gint openvrml_gtkplug_cmd_argc = 0; ! gchar ** openvrml_gtkplug_cmd_argv = 0; ! scope_guard openvrml_gtkplug_cmd_argv_guard = ! make_guard(g_strfreev, openvrml_gtkplug_cmd_argv); ! const gchar * const openvrml_gtkplug_cmd = ! g_getenv("OPENVRML_GTKPLUG"); ! if (!openvrml_gtkplug_cmd) { ! openvrml_gtkplug_cmd_argc = 1; ! openvrml_gtkplug_cmd_argv = ! static_cast<gchar **>(g_malloc0(sizeof (gchar *) * 2)); ! if (!openvrml_gtkplug_cmd_argv) { throw std::bad_alloc(); } ! openvrml_gtkplug_cmd_argv[0] = ! g_strdup(OPENVRML_LIBEXECDIR_ "/openvrml-gtkplug"); ! if (!openvrml_gtkplug_cmd_argv[0]) { throw std::bad_alloc(); } ! } else { GError * error = 0; ! gboolean succeeded = ! g_shell_parse_argv(openvrml_gtkplug_cmd, ! &openvrml_gtkplug_cmd_argc, ! &openvrml_gtkplug_cmd_argv, ! &error); if (!succeeded) { if (error) { *************** *** 1178,1217 **** } } ! // XXX ! // XXX Not the least bit exception-safe. This needs some ! // XXX ScopeGuard love. ! // XXX ! g_free(working_directory); ! g_free(argv); ! g_strfreev(openvrml_gtkplug_cmd_argv); ! if (succeeded) { ! this->command_channel = g_io_channel_unix_new(standard_input); ! if (!this->command_channel) { throw std::bad_alloc(); } ! const GIOStatus status = ! g_io_channel_set_encoding(this->command_channel, ! 0, // binary (no encoding) ! &error); ! if (status != G_IO_STATUS_NORMAL) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } ! // XXX ! // XXX Should probably throw here instead. ! // XXX ! return; ! } ! this->request_channel = g_io_channel_unix_new(standard_output); ! if (!this->command_channel) { throw std::bad_alloc(); } ! this->request_channel_watch_id = ! g_io_add_watch(this->request_channel, ! G_IO_IN, ! request_data_available, ! this); } } } --- 1143,1220 ---- } } + } ! string socket_id_arg = lexical_cast<string>(this->window); ! const char * socket_id_arg_c_str = socket_id_arg.c_str(); ! vector<char> socket_id_arg_vec( ! socket_id_arg_c_str, ! socket_id_arg_c_str + socket_id_arg.length() + 1); ! const gint argv_size = openvrml_gtkplug_cmd_argc + 2; ! gchar ** const argv = ! static_cast<gchar **>(g_malloc(sizeof (gchar *) * argv_size)); ! if (!argv) { throw std::bad_alloc(); } ! scope_guard argv_guard = make_guard(g_free, argv); ! boost::ignore_unused_variable_warning(argv_guard); ! gint i; ! for (i = 0; i < openvrml_gtkplug_cmd_argc; ++i) { ! argv[i] = openvrml_gtkplug_cmd_argv[i]; ! } ! argv[i++] = &socket_id_arg_vec.front(); ! argv[i] = 0; ! gchar * const working_dir = g_get_current_dir(); ! if (!working_dir) { throw std::bad_alloc(); }; ! scope_guard working_dir_guard = make_guard(g_free, working_dir); ! boost::ignore_unused_variable_warning(working_dir_guard); ! ! gchar ** envp = 0; ! GPid * const child_pid = 0; ! gint standard_input, standard_output; ! gint * const standard_error = 0; ! GError * error = 0; ! gboolean succeeded = g_spawn_async_with_pipes(working_dir, ! argv, ! envp, ! GSpawnFlags(0), ! 0, ! 0, ! child_pid, ! &standard_input, ! &standard_output, ! standard_error, ! &error); ! if (!succeeded) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); } + return; + } + + this->command_channel = g_io_channel_unix_new(standard_input); + if (!this->command_channel) { throw std::bad_alloc(); } + const GIOStatus status = + g_io_channel_set_encoding(this->command_channel, + 0, // binary (no encoding) + &error); + if (status != G_IO_STATUS_NORMAL) { + if (error) { + g_critical(error->message); + g_error_free(error); + } + // XXX + // XXX Should probably throw here instead. + // XXX + return; } + + this->request_channel = g_io_channel_unix_new(standard_output); + if (!this->command_channel) { throw std::bad_alloc(); } + this->request_channel_watch_id = + g_io_add_watch(this->request_channel, + G_IO_IN, + request_data_available, + this); } |
From: Braden M. <br...@us...> - 2006-10-10 22:29:19
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12484 Modified Files: ChangeLog Log Message: Build against X11 if we are building under Cygwin with Cygwin X11. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1349 retrieving revision 1.1350 diff -C2 -d -r1.1349 -r1.1350 *** ChangeLog 10 Oct 2006 21:50:05 -0000 1.1349 --- ChangeLog 10 Oct 2006 22:29:16 -0000 1.1350 *************** *** 1,4 **** --- 1,9 ---- 2006-10-10 Braden McDaniel <br...@en...> + * lib/gtkglext/configure.in: Build against X11 if we are building + under Cygwin with Cygwin X11. + + 2006-10-10 Braden McDaniel <br...@en...> + * src/libopenvrml-gl/openvrml/gl/viewer.cpp (OPENVRML_GL_CALLBACK_): Don't apply __stdcall__ attribute if |
From: Braden M. <br...@us...> - 2006-10-10 22:29:19
|
Update of /cvsroot/openvrml/openvrml/lib/gtkglext In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12484/lib/gtkglext Modified Files: configure.in Log Message: Build against X11 if we are building under Cygwin with Cygwin X11. Index: configure.in =================================================================== RCS file: /cvsroot/openvrml/openvrml/lib/gtkglext/configure.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** configure.in 4 Oct 2006 02:29:15 -0000 1.3 --- configure.in 10 Oct 2006 22:29:16 -0000 1.4 *************** *** 172,176 **** AM_CONDITIONAL([MS_LIB_AVAILABLE], [test "x$ms_librarian" = "xyes"]) ! if test "x$platform_win32" = "xyes"; then gdktarget=win32 else --- 172,178 ---- AM_CONDITIONAL([MS_LIB_AVAILABLE], [test "x$ms_librarian" = "xyes"]) ! AC_PATH_XTRA ! ! if test "x$platform_win32" = "xyes" -a "x$no_x" = "xyes"; then gdktarget=win32 else *************** *** 439,444 **** if test "x$gdktarget" = "xx11"; then - AC_PATH_XTRA - save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" --- 441,444 ---- |