whitespace cleanup
This commit is contained in:
parent
bd15cbd5aa
commit
999026abb7
|
@ -355,15 +355,15 @@ bufferstream& bufferstream::operator<< (const streamable& obj)
|
||||||
*/
|
*/
|
||||||
void bufferstream::readString(std::string &str, const int fixed_length, const bool terminated)
|
void bufferstream::readString(std::string &str, const int fixed_length, const bool terminated)
|
||||||
{
|
{
|
||||||
if (fixed_length) // fixed length
|
if (fixed_length) // FIXED LENGTH
|
||||||
{
|
{
|
||||||
uint8_t buffer[fixed_length];
|
uint8_t buffer[fixed_length];
|
||||||
read(buffer, fixed_length);
|
read(buffer, fixed_length);
|
||||||
if (gcount() != fixed_length)
|
if (gcount() != fixed_length)
|
||||||
return setstate(std::ios_base::failbit);
|
return setstate(std::ios_base::failbit);
|
||||||
str += std::string(reinterpret_cast<char*>(buffer));
|
str += std::string(reinterpret_cast<char*>(buffer));
|
||||||
}
|
} // end FIXED LENGTH
|
||||||
else // variable length
|
else // VARIABLE LENGTH
|
||||||
{
|
{
|
||||||
if (terminated) // null terminated
|
if (terminated) // null terminated
|
||||||
{
|
{
|
||||||
|
@ -381,7 +381,7 @@ void bufferstream::readString(std::string &str, const int fixed_length, const bo
|
||||||
str += std::string(reinterpret_cast<char*>(data()), available());
|
str += std::string(reinterpret_cast<char*>(data()), available());
|
||||||
setstate(std::ios_base::eofbit);
|
setstate(std::ios_base::eofbit);
|
||||||
}
|
}
|
||||||
}
|
} // end VARIABLE LENGTH
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user