diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-05-29 16:00:39 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-05-29 16:00:39 +0200 |
commit | b5434960947f06f914569324d0b5e803eb7d4eef (patch) | |
tree | 77afa0c94d02fac313f7f50bf5cc7511084d7b37 /fastlib/src | |
parent | a66eda704b566a80786d19584bdbad43b7ec89d8 (diff) |
Reduce fastos.h dependency.
Diffstat (limited to 'fastlib/src')
19 files changed, 59 insertions, 59 deletions
diff --git a/fastlib/src/vespa/fastlib/io/bufferedfile.cpp b/fastlib/src/vespa/fastlib/io/bufferedfile.cpp index ae498595e35..04376826139 100644 --- a/fastlib/src/vespa/fastlib/io/bufferedfile.cpp +++ b/fastlib/src/vespa/fastlib/io/bufferedfile.cpp @@ -1,8 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -// Copyright (C) 2000 Fast Search & Transfer -#include <vespa/fastos/fastos.h> -#include <vespa/fastlib/io/bufferedfile.h> +#include "bufferedfile.h" namespace { diff --git a/fastlib/src/vespa/fastlib/io/bufferedinputstream.cpp b/fastlib/src/vespa/fastlib/io/bufferedinputstream.cpp index 26bab632aeb..dd212ddfd08 100644 --- a/fastlib/src/vespa/fastlib/io/bufferedinputstream.cpp +++ b/fastlib/src/vespa/fastlib/io/bufferedinputstream.cpp @@ -1,11 +1,13 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> + #include "bufferedinputstream.h" +#include <cstring> +#include <cstdint> Fast_BufferedInputStream::Fast_BufferedInputStream(Fast_InputStream &in, size_t bufferSize) : Fast_FilterInputStream(in), _buffer(new char[bufferSize]), - _bufferSize((_buffer != NULL) ? bufferSize : 0), + _bufferSize((_buffer != nullptr) ? bufferSize : 0), _bufferUsed(0), _bufferRead(0), _nextWillFail(false) diff --git a/fastlib/src/vespa/fastlib/io/bufferedoutputstream.cpp b/fastlib/src/vespa/fastlib/io/bufferedoutputstream.cpp index b025a5dba25..7377c666cf4 100644 --- a/fastlib/src/vespa/fastlib/io/bufferedoutputstream.cpp +++ b/fastlib/src/vespa/fastlib/io/bufferedoutputstream.cpp @@ -11,11 +11,9 @@ * ALL RIGHTS RESERVED * ******************************************************************************/ -#include <vespa/fastos/fastos.h> -#include "bufferedoutputstream.h" - - +#include "bufferedoutputstream.h" +#include <cstring> Fast_BufferedOutputStream::Fast_BufferedOutputStream(Fast_OutputStream &out, size_t bufferSize) @@ -33,7 +31,7 @@ Fast_BufferedOutputStream::Fast_BufferedOutputStream(Fast_OutputStream &out, Fast_BufferedOutputStream::~Fast_BufferedOutputStream(void) { delete [] _buffer; -}; +} diff --git a/fastlib/src/vespa/fastlib/io/fileinputstream.cpp b/fastlib/src/vespa/fastlib/io/fileinputstream.cpp index d501a752cfe..2d00935df79 100644 --- a/fastlib/src/vespa/fastlib/io/fileinputstream.cpp +++ b/fastlib/src/vespa/fastlib/io/fileinputstream.cpp @@ -11,10 +11,8 @@ * ALL RIGHTS RESERVED * ******************************************************************************/ -#include <vespa/fastos/fastos.h> -#include <limits.h> -#include <vespa/fastlib/io/fileinputstream.h> +#include "fileinputstream.h" Fast_FileInputStream::Fast_FileInputStream(const char *fileName) : _theFile(new FastOS_File(fileName)), @@ -23,7 +21,7 @@ Fast_FileInputStream::Fast_FileInputStream(const char *fileName) _fileOpenedOk = _theFile->OpenReadOnly(); } -Fast_FileInputStream::~Fast_FileInputStream(void) +Fast_FileInputStream::~Fast_FileInputStream() { Close(); delete _theFile; diff --git a/fastlib/src/vespa/fastlib/io/fileoutputstream.cpp b/fastlib/src/vespa/fastlib/io/fileoutputstream.cpp index fddbea0fc41..7f5f6bed1eb 100644 --- a/fastlib/src/vespa/fastlib/io/fileoutputstream.cpp +++ b/fastlib/src/vespa/fastlib/io/fileoutputstream.cpp @@ -12,9 +12,8 @@ * ******************************************************************************/ -#include <vespa/fastos/fastos.h> -#include <vespa/fastlib/io/fileoutputstream.h> - +#include "fileoutputstream.h" +#include <vespa/fastos/file.h> Fast_FileOutputStream::Fast_FileOutputStream(const char *fileName) @@ -29,3 +28,15 @@ Fast_FileOutputStream::~Fast_FileOutputStream(void) _theFile->Close(); delete _theFile; } + +ssize_t +Fast_FileOutputStream::Write(const void *sourceBuffer, size_t bufferSize) { + return _theFile->CheckedWrite(sourceBuffer, bufferSize) ? + static_cast<ssize_t>(bufferSize) : + static_cast<ssize_t>(-1); +}; + +bool +Fast_FileOutputStream::Close() { + return _theFile->Close(); +}
\ No newline at end of file diff --git a/fastlib/src/vespa/fastlib/io/fileoutputstream.h b/fastlib/src/vespa/fastlib/io/fileoutputstream.h index eb97b3f8207..af7db086ed9 100644 --- a/fastlib/src/vespa/fastlib/io/fileoutputstream.h +++ b/fastlib/src/vespa/fastlib/io/fileoutputstream.h @@ -4,6 +4,8 @@ #include "outputstream.h" +class FastOS_FileInterface; + class Fast_FileOutputStream : public Fast_OutputStream { private: @@ -19,12 +21,8 @@ public: Fast_FileOutputStream(const char *fileName); ~Fast_FileOutputStream(); - ssize_t Write(const void *sourceBuffer, size_t bufferSize) override { - return _theFile->CheckedWrite(sourceBuffer, bufferSize) ? - static_cast<ssize_t>(bufferSize) : - static_cast<ssize_t>(-1); - }; + ssize_t Write(const void *sourceBuffer, size_t bufferSize) override; - bool Close() override { return _theFile->Close(); } + bool Close() override; void Flush() override {} }; diff --git a/fastlib/src/vespa/fastlib/io/outputstream.h b/fastlib/src/vespa/fastlib/io/outputstream.h index d09aa6e436a..ba4d74f1a7a 100644 --- a/fastlib/src/vespa/fastlib/io/outputstream.h +++ b/fastlib/src/vespa/fastlib/io/outputstream.h @@ -13,8 +13,7 @@ ******************************************************************************/ #pragma once - - +#include <cstdlib> class Fast_OutputStream { @@ -22,7 +21,7 @@ public: virtual ~Fast_OutputStream() { } - virtual bool Close(void) = 0; - virtual void Flush(void) = 0; + virtual bool Close() = 0; + virtual void Flush() = 0; virtual ssize_t Write(const void *sourceBuffer, size_t bufferSize) = 0; }; diff --git a/fastlib/src/vespa/fastlib/net/httpchunkedinputstream.cpp b/fastlib/src/vespa/fastlib/net/httpchunkedinputstream.cpp index e7d40ad9b75..e7386dcc3f4 100644 --- a/fastlib/src/vespa/fastlib/net/httpchunkedinputstream.cpp +++ b/fastlib/src/vespa/fastlib/net/httpchunkedinputstream.cpp @@ -12,9 +12,9 @@ * ******************************************************************************/ -#include <vespa/fastos/fastos.h> -#include <string.h> -#include <vespa/fastlib/net/httpchunkedinputstream.h> +#include "httpchunkedinputstream.h" +#include <cstring> +#include <cstdlib> Fast_HTTPChunkedInputStream::Fast_HTTPChunkedInputStream(Fast_InputStream &in) : Fast_FilterInputStream(in), _chunkSize(0), _inChunk(false), diff --git a/fastlib/src/vespa/fastlib/net/httpchunkedoutputstream.cpp b/fastlib/src/vespa/fastlib/net/httpchunkedoutputstream.cpp index 048ac85c8db..915d8e69223 100644 --- a/fastlib/src/vespa/fastlib/net/httpchunkedoutputstream.cpp +++ b/fastlib/src/vespa/fastlib/net/httpchunkedoutputstream.cpp @@ -12,9 +12,10 @@ * ******************************************************************************/ -#include <vespa/fastos/fastos.h> -#include <string.h> -#include <vespa/fastlib/net/httpchunkedoutputstream.h> +#include "httpchunkedoutputstream.h" +#include <cassert> +#include <cstdio> +#include <cstring> Fast_HTTPChunkedOutputStream::Fast_HTTPChunkedOutputStream(Fast_OutputStream &out, size_t chunkSize) diff --git a/fastlib/src/vespa/fastlib/net/httpheaderparser.cpp b/fastlib/src/vespa/fastlib/net/httpheaderparser.cpp index 8f1dadef052..86fe3feabcf 100644 --- a/fastlib/src/vespa/fastlib/net/httpheaderparser.cpp +++ b/fastlib/src/vespa/fastlib/net/httpheaderparser.cpp @@ -1,7 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> + +#include "httpheaderparser.h" #include <vespa/fastlib/io/bufferedinputstream.h> -#include <vespa/fastlib/net/httpheaderparser.h> +#include <cstdio> +#include <cstring> Fast_HTTPHeaderParser::Fast_HTTPHeaderParser(Fast_BufferedInputStream &in) : _pushBack(0), diff --git a/fastlib/src/vespa/fastlib/net/httpheaderparser.h b/fastlib/src/vespa/fastlib/net/httpheaderparser.h index ccd6c24ed37..94f6bccbdb4 100644 --- a/fastlib/src/vespa/fastlib/net/httpheaderparser.h +++ b/fastlib/src/vespa/fastlib/net/httpheaderparser.h @@ -2,6 +2,8 @@ #pragma once +#include <cstddef> + class Fast_BufferedInputStream; class Fast_HTTPHeaderParser diff --git a/fastlib/src/vespa/fastlib/net/socket.cpp b/fastlib/src/vespa/fastlib/net/socket.cpp index 1c7d915dc10..be463088bb3 100644 --- a/fastlib/src/vespa/fastlib/net/socket.cpp +++ b/fastlib/src/vespa/fastlib/net/socket.cpp @@ -1,5 +1,5 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> + #include "socket.h" Fast_Socket::~Fast_Socket() diff --git a/fastlib/src/vespa/fastlib/net/url.cpp b/fastlib/src/vespa/fastlib/net/url.cpp index 13cb0a5e2a7..a62a5171983 100644 --- a/fastlib/src/vespa/fastlib/net/url.cpp +++ b/fastlib/src/vespa/fastlib/net/url.cpp @@ -12,12 +12,9 @@ * */ -/** - * Encode and decode a URL - */ -#include <vespa/fastos/fastos.h> #include "url.h" +#include <cstdio> void Fast_URL::decode(const char *encodedURL, char *decodedURL, int bufsize) diff --git a/fastlib/src/vespa/fastlib/text/apps/extcase.cpp b/fastlib/src/vespa/fastlib/text/apps/extcase.cpp index 1200465331c..5f7579287e0 100644 --- a/fastlib/src/vespa/fastlib/text/apps/extcase.cpp +++ b/fastlib/src/vespa/fastlib/text/apps/extcase.cpp @@ -14,7 +14,6 @@ * ALL RIGHTS RESERVED */ -#include <vespa/fastos/fastos.h> #include <vespa/fastlib/io/bufferedfile.h> unsigned int lowercase[65536]; diff --git a/fastlib/src/vespa/fastlib/text/apps/unicode_propertydump.cpp b/fastlib/src/vespa/fastlib/text/apps/unicode_propertydump.cpp index a0ee05b9b5d..8a1260a5355 100644 --- a/fastlib/src/vespa/fastlib/text/apps/unicode_propertydump.cpp +++ b/fastlib/src/vespa/fastlib/text/apps/unicode_propertydump.cpp @@ -1,6 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> + #include <vespa/fastlib/text/unicodeutil.h> +#include <vespa/fastos/app.h> class UnicodePropertyDumpApp : public FastOS_Application { diff --git a/fastlib/src/vespa/fastlib/text/apps/unicode_tolowerdump.cpp b/fastlib/src/vespa/fastlib/text/apps/unicode_tolowerdump.cpp index ffea4d735ba..b000645295a 100644 --- a/fastlib/src/vespa/fastlib/text/apps/unicode_tolowerdump.cpp +++ b/fastlib/src/vespa/fastlib/text/apps/unicode_tolowerdump.cpp @@ -1,6 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> + #include <vespa/fastlib/text/unicodeutil.h> +#include <vespa/fastos/app.h> class UnicodeToLowerDumpApp : public FastOS_Application { diff --git a/fastlib/src/vespa/fastlib/text/unicodeutil.cpp b/fastlib/src/vespa/fastlib/text/unicodeutil.cpp index 822f8044ded..c0c88a61728 100644 --- a/fastlib/src/vespa/fastlib/text/unicodeutil.cpp +++ b/fastlib/src/vespa/fastlib/text/unicodeutil.cpp @@ -1,8 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/fastlib/text/unicodeutil.h> +#include "unicodeutil.h" #include <cstdlib> +#include <cstdint> +#include <cassert> #include "unicodeutil-charprops.cpp" #include "unicodeutil-lowercase.cpp" @@ -22,7 +23,7 @@ Initialize _G_Initializer; } void -Fast_UnicodeUtil::InitTables(void) +Fast_UnicodeUtil::InitTables() { /** * Hack for Katakana accent marks (torgeir) diff --git a/fastlib/src/vespa/fastlib/text/wordfolder.cpp b/fastlib/src/vespa/fastlib/text/wordfolder.cpp index de4f0daae3e..221960e046c 100644 --- a/fastlib/src/vespa/fastlib/text/wordfolder.cpp +++ b/fastlib/src/vespa/fastlib/text/wordfolder.cpp @@ -1,7 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> -#include <vespa/fastlib/text/wordfolder.h> -Fast_WordFolder::~Fast_WordFolder(void) +#include "wordfolder.h" + +Fast_WordFolder::~Fast_WordFolder() { } diff --git a/fastlib/src/vespa/fastlib/util/base64.cpp b/fastlib/src/vespa/fastlib/util/base64.cpp index c87cba28e5d..7cd9b35edac 100644 --- a/fastlib/src/vespa/fastlib/util/base64.cpp +++ b/fastlib/src/vespa/fastlib/util/base64.cpp @@ -6,17 +6,9 @@ * Utility functions for base-64 encoding/decoding. *****************************************************************************/ -#include <vespa/fastos/fastos.h> -#include <stdio.h> -#include <ctype.h> #include "base64.h" - -/** -***************************************************************************** -* Define lookup table. -* -* @author Aleksander Øhrn -*****************************************************************************/ +#include <cstdio> +#include <cctype> static const char _base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; |