Base: Rename ASCIIInputStream to TextInputStream

This commit is contained in:
Chris Hennes
2024-02-19 21:02:34 -06:00
committed by wwmayer
parent aed799ce2a
commit 5d1c4caba0
3 changed files with 23 additions and 23 deletions

View File

@@ -621,7 +621,7 @@ void StringHasher::RestoreDocFile(Base::Reader& reader)
void StringHasher::restoreStreamNew(std::istream& stream, std::size_t count)
{
Base::ASCIIInputStream asciiStream (stream);
Base::TextInputStream asciiStream (stream);
_hashes->clear();
std::string content;
boost::io::ios_flags_saver ifs(stream);

View File

@@ -836,7 +836,7 @@ std::streambuf::pos_type Streambuf::seekpos(std::streambuf::pos_type pos,
// The custom string handler written by realthunder for the LinkStage3 toponaming code, to handle
// reading multi-line strings directly into a std::string. Imported from LinkStage3 and refactored
// during the TNP mitigation project in February 2024.
ASCIIInputStream& ASCIIInputStream::operator>>(std::string& outputString)
TextInputStream& TextInputStream::operator>>(std::string& outputString)
{
uint32_t numberOfLines;
char inputChar;

View File

@@ -142,38 +142,38 @@ private:
};
/**
* The ASCIIInputStream class provides reading of ASCII data from an istream, with custom handling
* The TextInputStream class provides reading of ASCII data from an istream, with custom handling
* for std::string to make it easier to read a single multi-line (or multi-word) string. This is
* designed for easy compatibility with the LinkStage3 implementation of the InputStream class, used
* to store StringHashers for the toponaming mitigation technique.
*/
class BaseExport ASCIIInputStream: public Stream
class BaseExport TextInputStream: public Stream
{
public:
/** Constructor
* @param rin: upstream input
*/
explicit ASCIIInputStream(std::istream& rin)
explicit TextInputStream(std::istream& rin)
: _in(rin)
{}
ASCIIInputStream(const ASCIIInputStream&) = delete;
TextInputStream(const TextInputStream&) = delete;
ASCIIInputStream(const ASCIIInputStream&&) noexcept = delete;
TextInputStream(const TextInputStream&&) noexcept = delete;
void operator=(const ASCIIInputStream&) = delete;
void operator=(const TextInputStream&) = delete;
void operator=(const ASCIIInputStream&&) = delete;
void operator=(const TextInputStream&&) = delete;
~ASCIIInputStream() override = default;
~TextInputStream() override = default;
ASCIIInputStream& operator>>(bool& input)
TextInputStream& operator>>(bool& input)
{
_in >> input;
return *this;
}
ASCIIInputStream& operator>>(int8_t& ch)
TextInputStream& operator>>(int8_t& ch)
{
int index {};
_in >> index;
@@ -181,7 +181,7 @@ public:
return *this;
}
ASCIIInputStream& operator>>(uint8_t& uch)
TextInputStream& operator>>(uint8_t& uch)
{
unsigned uns {};
_in >> uns;
@@ -189,57 +189,57 @@ public:
return *this;
}
ASCIIInputStream& operator>>(int16_t& int16)
TextInputStream& operator>>(int16_t& int16)
{
_in >> int16;
return *this;
}
ASCIIInputStream& operator>>(uint16_t& us)
TextInputStream& operator>>(uint16_t& us)
{
_in >> us;
return *this;
}
ASCIIInputStream& operator>>(int32_t& int32)
TextInputStream& operator>>(int32_t& int32)
{
_in >> int32;
return *this;
}
ASCIIInputStream& operator>>(uint32_t& ui)
TextInputStream& operator>>(uint32_t& ui)
{
_in >> ui;
return *this;
}
ASCIIInputStream& operator>>(int64_t& int64)
TextInputStream& operator>>(int64_t& int64)
{
_in >> int64;
return *this;
}
ASCIIInputStream& operator>>(uint64_t& ul)
TextInputStream& operator>>(uint64_t& ul)
{
_in >> ul;
return *this;
}
ASCIIInputStream& operator>>(float& flt)
TextInputStream& operator>>(float& flt)
{
_in >> flt;
return *this;
}
ASCIIInputStream& operator>>(double& dbl)
TextInputStream& operator>>(double& dbl)
{
_in >> dbl;
return *this;
}
ASCIIInputStream& operator>>(std::string& str);
TextInputStream& operator>>(std::string& str);
ASCIIInputStream& operator>>(char& chr)
TextInputStream& operator>>(char& chr)
{
chr = (char)_in.get();
return *this;