diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-01-02 19:57:46 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2017-01-02 19:57:46 +0000 |
commit | 06c9fef83dbbb1363bd69f48b5801d4e7365c389 (patch) | |
tree | 4cc954d6a2ed249c774184687d533055043d1c57 | |
parent | Fix support for model part types of optional converted (diff) | |
download | slicer-1.4.3.tar.bz2 slicer-1.4.3.tar.xz slicer-1.4.3.zip |
Use compile time formatter instead of boost::formatslicer-1.4.3
-rw-r--r-- | slicer/db/sqlCommon.cpp | 6 | ||||
-rw-r--r-- | slicer/slicer/slicer.cpp | 26 | ||||
-rw-r--r-- | slicer/xml/serializer.cpp | 6 |
3 files changed, 19 insertions, 19 deletions
diff --git a/slicer/db/sqlCommon.cpp b/slicer/db/sqlCommon.cpp index 645c10f..d484967 100644 --- a/slicer/db/sqlCommon.cpp +++ b/slicer/db/sqlCommon.cpp @@ -1,5 +1,5 @@ #include <sqlExceptions.h> -#include <boost/format.hpp> +#include <compileTimeFormatter.h> namespace Slicer { void TooManyRowsReturned::ice_print(std::ostream & s) const @@ -17,10 +17,10 @@ namespace Slicer { s << "No rows found"; } + AdHocFormatter(UnsuitableIdFieldTypeMsg, "Unsuitable id field type [%?]"); void UnsuitableIdFieldType::ice_print(std::ostream & s) const { - static boost::format f("Unsuitable id field type [%s]"); - s << f % type; + UnsuitableIdFieldTypeMsg::write(s, type); } } diff --git a/slicer/slicer/slicer.cpp b/slicer/slicer/slicer.cpp index ee2a95f..dbda326 100644 --- a/slicer/slicer/slicer.cpp +++ b/slicer/slicer/slicer.cpp @@ -1,6 +1,6 @@ #include "slicer.h" #include <common.h> -#include <boost/format.hpp> +#include <compileTimeFormatter.h> namespace Slicer { Slicer::MemberChildRef::MemberChildRef(Slicer::ModelPartPtr mp, const Slicer::Metadata & md) : @@ -38,32 +38,32 @@ namespace Slicer { return emptyMetadata; } + AdHocFormatter(InvalidEnumerationSymbolMsg, "Invalid enumeration symbol [%?] for type [%?]"); void InvalidEnumerationSymbol::ice_print(std::ostream & s) const { - static boost::format f("Invalid enumeration symbol [%s] for type [%s]"); - s << f % symbol % type; + InvalidEnumerationSymbolMsg::write(s, symbol, type); } + AdHocFormatter(InvalidEnumerationValueMsg, "Invalid enumeration symbol [%?] for type [%?]"); void InvalidEnumerationValue::ice_print(std::ostream & s) const { - static boost::format f("Invalid enumeration symbol [%d] for type [%s]"); - s << f % value % type; + InvalidEnumerationValueMsg::write(s, value, type); } + AdHocFormatter(UnknownTypeMsg, "Unknown type [%?]"); void UnknownType::ice_print(std::ostream & s) const { - static boost::format f("Unknown type [%s]"); - s << f % type; + UnknownTypeMsg::write(s, type); } + AdHocFormatter(NoConversionFoundMsg, "No conversion found for type [%?]"); void NoConversionFound::ice_print(std::ostream & s) const { - static boost::format f("No conversion found for type [%s]"); - s << f % type; + NoConversionFoundMsg::write(s, type); } void @@ -78,11 +78,11 @@ namespace Slicer { s << "Unsupported model type"; } + AdHocFormatter(IncorrectElementNameMsg, "Incorrect element name [%?]"); void IncorrectElementName::ice_print(std::ostream & s) const { - static boost::format f("Incorrect element name [%s]"); - s << f % name; + IncorrectElementNameMsg::write(s, name); } void @@ -103,11 +103,11 @@ namespace Slicer { s << "General runtime error"; } + AdHocFormatter(CompilerErrorMsg, "Slicer compiler: %?"); void CompilerError::ice_print(std::ostream & s) const { - static boost::format f("Slicer compiler: %s"); - s << f % what; + CompilerErrorMsg::write(s, what); } } diff --git a/slicer/xml/serializer.cpp b/slicer/xml/serializer.cpp index 307819a..08101ba 100644 --- a/slicer/xml/serializer.cpp +++ b/slicer/xml/serializer.cpp @@ -8,7 +8,7 @@ #include <boost/intrusive_ptr.hpp> #include <stdexcept> #include <glibmm/ustring.h> -#include <boost/format.hpp> +#include <compileTimeFormatter.h> NAMEDFACTORY(".xml", Slicer::XmlFileSerializer, Slicer::FileSerializerFactory); NAMEDFACTORY(".xml", Slicer::XmlFileDeserializer, Slicer::FileDeserializerFactory); @@ -438,10 +438,10 @@ namespace Slicer { modelRoot->OnEachChild(boost::bind(&XmlSerializer::ModelTreeIterateRoot, doc, _1, _2)); } + AdHocFormatter(BadBooleanValueMsg, "Bad boolean value [%?]"); void BadBooleanValue::ice_print(std::ostream & s) const { - static boost::format f("Bad boolean value [%s]"); - s << f % text; + BadBooleanValueMsg::write(s, text); } } |