|
From: Braden M. <br...@us...> - 2006-02-17 06:25:20
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5763/src/libopenvrml/openvrml Modified Files: vrml97node.cpp Log Message: Moved FontconfigError and FreeTypeError exception classes out of the function so that they can be template parameters; that is, so they can be used with boost::ignore_unused_variable_warning. Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** vrml97node.cpp 12 Feb 2006 09:40:17 -0000 1.96 --- vrml97node.cpp 17 Feb 2006 06:25:16 -0000 1.97 *************** *** 22358,22361 **** --- 22358,22400 ---- # endif // OPENVRML_ENABLE_RENDER_TEXT_NODE + # ifdef OPENVRML_ENABLE_RENDER_TEXT_NODE + + const char * const fcResultMessage[] = { "match", + "no match", + "type mismatch", + "no id" }; + + // + // FontconfigError and FreeTypeError are never thrown out of the library. + // + + class OPENVRML_LOCAL FontconfigError : public std::runtime_error { + public: + explicit FontconfigError(const FcResult result): + std::runtime_error(fcResultMessage[result]) + {} + + virtual ~FontconfigError() OPENVRML_NOTHROW + {} + }; + + class OPENVRML_LOCAL FreeTypeError : public std::runtime_error { + public: + // + // The normal build of FreeType doesn't include a means of mapping + // error codes to human-readable strings. There's a means of + // letting client apps do this by defining some macros, but that's + // too much trouble for now. + // + explicit FreeTypeError(FT_Error): + std::runtime_error("FreeType error") + {} + + virtual ~FreeTypeError() OPENVRML_NOTHROW + {} + }; + + # endif // OPENVRML_ENABLE_RENDER_TEXT_NODE + /** * @brief Called when @a fontStyle changes to update the font face. *************** *** 22366,22400 **** { # ifdef OPENVRML_ENABLE_RENDER_TEXT_NODE - static const char * const fcResultMessage[] = { "match", - "no match", - "type mismatch", - "no id" }; - - class FontconfigError : public std::runtime_error { - public: - explicit FontconfigError(const FcResult result): - std::runtime_error(fcResultMessage[result]) - {} - - virtual ~FontconfigError() OPENVRML_NOTHROW - {} - }; - - class FreeTypeError : public std::runtime_error { - public: - // - // The normal build of FreeType doesn't include a means of mapping - // error codes to human-readable strings. There's a means of - // letting client apps do this by defining some macros, but that's - // too much trouble for now. - // - explicit FreeTypeError(FT_Error): - std::runtime_error("FreeType error") - {} - - virtual ~FreeTypeError() OPENVRML_NOTHROW - {} - }; - using std::string; typedef std::basic_string<FcChar8, FcChar8_traits> FcChar8_string; --- 22405,22408 ---- |