diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-06-02 02:13:59 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-06-06 09:12:37 +0200 |
commit | 280a8aca27af8cea3a532900809b251fa353cd52 (patch) | |
tree | ffaf41b4bbc185092fe157c332371cd8451ad85f /staging_vespalib | |
parent | 058c307d819e3955a39e01658c57e8c75b9dc6bb (diff) |
Include stringfmt where it was needed.
Diffstat (limited to 'staging_vespalib')
8 files changed, 24 insertions, 22 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/encoding/base64.cpp b/staging_vespalib/src/vespa/vespalib/encoding/base64.cpp index 10bc2af51ce..54ac8363bf6 100644 --- a/staging_vespalib/src/vespa/vespalib/encoding/base64.cpp +++ b/staging_vespalib/src/vespa/vespalib/encoding/base64.cpp @@ -8,7 +8,8 @@ #include <vespa/vespalib/encoding/base64.h> #include <vespa/vespalib/util/exceptions.h> -#include <assert.h> +#include <vespa/vespalib/util/stringfmt.h> +#include <cassert> namespace vespalib { @@ -129,9 +130,8 @@ Base64::decode(const char* inBuffer, int inLen, char* outBuffer, int outLen) continue; // Some illegal chars will be skipped. } else if (curchar == -1) { // Other illegal characters will generate failure - throw vespalib::IllegalArgumentException(vespalib::make_string( - "Illegal base64 character %u found.", - (unsigned int) *thischar), VESPA_STRLOC); + throw IllegalArgumentException(make_string("Illegal base64 character %u found.", + (unsigned int) *thischar), VESPA_STRLOC); } else { // Four bytes from input (eqals three bytes in output) @@ -162,4 +162,3 @@ Base64::decode(const char* inBuffer, int inLen, char* outBuffer, int outLen) } } // namespace vespalib - diff --git a/staging_vespalib/src/vespa/vespalib/net/http_server.cpp b/staging_vespalib/src/vespa/vespalib/net/http_server.cpp index 32b9caab687..2c67a3c48c9 100644 --- a/staging_vespalib/src/vespa/vespalib/net/http_server.cpp +++ b/staging_vespalib/src/vespa/vespalib/net/http_server.cpp @@ -3,7 +3,7 @@ #include "http_server.h" #include <vespa/vespalib/util/exceptions.h> #include <vespa/vespalib/util/host_name.h> -#include <algorithm> +#include <vespa/vespalib/util/stringfmt.h> namespace vespalib { diff --git a/staging_vespalib/src/vespa/vespalib/util/document_runnable.cpp b/staging_vespalib/src/vespa/vespalib/util/document_runnable.cpp index 7c581c89af0..576343245e4 100644 --- a/staging_vespalib/src/vespa/vespalib/util/document_runnable.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/document_runnable.cpp @@ -2,6 +2,7 @@ #include "document_runnable.h" #include <vespa/vespalib/util/exceptions.h> +#include <vespa/vespalib/util/stringfmt.h> namespace document { diff --git a/staging_vespalib/src/vespa/vespalib/util/jsonstream.cpp b/staging_vespalib/src/vespa/vespalib/util/jsonstream.cpp index e8f242879d8..c7a7ac34ef3 100644 --- a/staging_vespalib/src/vespa/vespalib/util/jsonstream.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/jsonstream.cpp @@ -4,6 +4,7 @@ #include "jsonexception.h" #include <vespa/vespalib/util/exceptions.h> #include <vespa/vespalib/stllike/asciistream.h> +#include <vespa/vespalib/util/stringfmt.h> namespace vespalib { @@ -18,7 +19,7 @@ JsonStream::getStateName(const State& s) { throw IllegalStateException("Control should not reach this point", VESPA_STRLOC); } -JsonStream::JsonStream(vespalib::asciistream& as, bool createIndents) +JsonStream::JsonStream(asciistream& as, bool createIndents) : _writer(as) { if (createIndents) _writer.setPretty(); @@ -28,7 +29,7 @@ JsonStream::JsonStream(vespalib::asciistream& as, bool createIndents) JsonStream::~JsonStream() {} JsonStream& -JsonStream::operator<<(vespalib::stringref value) +JsonStream::operator<<(stringref value) { if (_state.empty()) { fail("Stream already finalized. Can't add a string value."); @@ -314,7 +315,7 @@ JsonStream::finalize() string JsonStream::getStateString() const { - vespalib::asciistream as; + asciistream as; for (auto it(_state.begin()), mt(_state.end()); it != mt; it++) { switch (it->state) { case State::OBJECT_EXPECTING_KEY: @@ -343,7 +344,7 @@ JsonStream::getStateString() const return as.str(); } -vespalib::string +string JsonStream::getJsonStreamState() const { asciistream report; @@ -360,4 +361,4 @@ JsonStream::fail(stringref error) const throw JsonStreamException(report.str(), "", VESPA_STRLOC); } -} // vespalib +} diff --git a/staging_vespalib/src/vespa/vespalib/util/librarypool.cpp b/staging_vespalib/src/vespa/vespalib/util/librarypool.cpp index 8dd6995a6c1..d992b1b6db8 100644 --- a/staging_vespalib/src/vespa/vespalib/util/librarypool.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/librarypool.cpp @@ -1,6 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + #include <vespa/vespalib/util/librarypool.h> #include <vespa/vespalib/util/exceptions.h> +#include <vespa/vespalib/util/stringfmt.h> namespace vespalib { @@ -17,14 +19,14 @@ LibraryPool::~LibraryPool() } void -LibraryPool::loadLibrary(const vespalib::stringref & libName) +LibraryPool::loadLibrary(const stringref & libName) { LockGuard guard(_lock); if (_libraries.find(libName) == _libraries.end()) { DynamicLibrarySP lib(new FastOS_DynamicLibrary); - vespalib::string file(libName); + string file(libName); if (!lib->Open(file.c_str())) { - vespalib::string error = lib->GetLastErrorString(); + string error = lib->GetLastErrorString(); throw IllegalArgumentException(make_string("Failed loading dynamic library '%s' due to '%s'.", file.c_str(), error.c_str())); } else { @@ -34,7 +36,7 @@ LibraryPool::loadLibrary(const vespalib::stringref & libName) } FastOS_DynamicLibrary * -LibraryPool::get(const vespalib::stringref & name) +LibraryPool::get(const stringref & name) { LockGuard guard(_lock); LibraryMap::const_iterator found(_libraries.find(name)); @@ -44,7 +46,7 @@ LibraryPool::get(const vespalib::stringref & name) } const FastOS_DynamicLibrary * -LibraryPool::get(const vespalib::stringref & name) const +LibraryPool::get(const stringref & name) const { LockGuard guard(_lock); LibraryMap::const_iterator found(_libraries.find(name)); diff --git a/staging_vespalib/src/vespa/vespalib/util/programoptions.cpp b/staging_vespalib/src/vespa/vespalib/util/programoptions.cpp index 41ff561011b..6573390c712 100644 --- a/staging_vespalib/src/vespa/vespalib/util/programoptions.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/programoptions.cpp @@ -1,7 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/vespalib/util/programoptions.h> - -#include <iostream> +#include "programoptions.h" +#include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/util/exceptions.h> #include <boost/lexical_cast.hpp> diff --git a/staging_vespalib/src/vespa/vespalib/util/xmlserializable.cpp b/staging_vespalib/src/vespa/vespalib/util/xmlserializable.cpp index 58a5489647d..043cddc3259 100644 --- a/staging_vespalib/src/vespa/vespalib/util/xmlserializable.cpp +++ b/staging_vespalib/src/vespa/vespalib/util/xmlserializable.cpp @@ -1,9 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/vespalib/util/xmlserializable.hpp> +#include "xmlserializable.hpp" #include <vespa/vespalib/encoding/base64.h> #include <vespa/vespalib/stllike/asciistream.h> -#include <vector> +#include <vespa/vespalib/util/stringfmt.h> #include <cassert> namespace vespalib { diff --git a/staging_vespalib/src/vespa/vespalib/util/xmlserializable.hpp b/staging_vespalib/src/vespa/vespalib/util/xmlserializable.hpp index 7fcc964d8f1..0da684d6b28 100644 --- a/staging_vespalib/src/vespa/vespalib/util/xmlserializable.hpp +++ b/staging_vespalib/src/vespa/vespalib/util/xmlserializable.hpp @@ -3,8 +3,8 @@ #pragma once #include "xmlserializable.h" -#include <sstream> #include <vespa/vespalib/util/exceptions.h> +#include <sstream> namespace vespalib { namespace xml { |