whitespace cleanup
This commit is contained in:
parent
bd15cbd5aa
commit
999026abb7
|
@ -54,7 +54,7 @@ uint32_t bufferstream::available()
|
||||||
* @brief bufferstream::data
|
* @brief bufferstream::data
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
uint8_t * bufferstream::data()
|
uint8_t *bufferstream::data()
|
||||||
{
|
{
|
||||||
return gptr();
|
return gptr();
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ uint32_t bufferstream::size()
|
||||||
* @brief bufferstream::base
|
* @brief bufferstream::base
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
uint8_t * bufferstream::base()
|
uint8_t *bufferstream::base()
|
||||||
{
|
{
|
||||||
return pbase();
|
return pbase();
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ uint8_t * bufferstream::base()
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator>> (uint8_t& val)
|
bufferstream &bufferstream::operator>> (uint8_t &val)
|
||||||
{
|
{
|
||||||
val = readType<uint8_t>();
|
val = readType<uint8_t>();
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -97,7 +97,7 @@ bufferstream& bufferstream::operator>> (uint8_t& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator>> (uint16_t& val)
|
bufferstream &bufferstream::operator>> (uint16_t &val)
|
||||||
{
|
{
|
||||||
val = readType<uint16_t>();
|
val = readType<uint16_t>();
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -109,7 +109,7 @@ bufferstream& bufferstream::operator>> (uint16_t& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator>> (uint32_t& val)
|
bufferstream &bufferstream::operator>> (uint32_t &val)
|
||||||
{
|
{
|
||||||
val = readType<uint32_t>();
|
val = readType<uint32_t>();
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -121,7 +121,7 @@ bufferstream& bufferstream::operator>> (uint32_t& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator>> (uint64_t& val)
|
bufferstream &bufferstream::operator>> (uint64_t &val)
|
||||||
{
|
{
|
||||||
val = readType<uint64_t>();
|
val = readType<uint64_t>();
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -133,7 +133,7 @@ bufferstream& bufferstream::operator>> (uint64_t& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator>> (int8_t& val)
|
bufferstream &bufferstream::operator>> (int8_t &val)
|
||||||
{
|
{
|
||||||
val = readType<int8_t>();
|
val = readType<int8_t>();
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -145,7 +145,7 @@ bufferstream& bufferstream::operator>> (int8_t& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator>> (int16_t& val)
|
bufferstream &bufferstream::operator>> (int16_t &val)
|
||||||
{
|
{
|
||||||
val = readType<int16_t>();
|
val = readType<int16_t>();
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -158,7 +158,7 @@ bufferstream& bufferstream::operator>> (int16_t& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator>> (int32_t& val)
|
bufferstream &bufferstream::operator>> (int32_t &val)
|
||||||
{
|
{
|
||||||
val = readType<int32_t>();
|
val = readType<int32_t>();
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -170,7 +170,7 @@ bufferstream& bufferstream::operator>> (int32_t& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator>> (int64_t& val)
|
bufferstream &bufferstream::operator>> (int64_t &val)
|
||||||
{
|
{
|
||||||
val = readType<int64_t>();
|
val = readType<int64_t>();
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -182,7 +182,7 @@ bufferstream& bufferstream::operator>> (int64_t& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator<< (const int8_t& val)
|
bufferstream &bufferstream::operator<< (const int8_t &val)
|
||||||
{
|
{
|
||||||
put(val);
|
put(val);
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -194,7 +194,7 @@ bufferstream& bufferstream::operator<< (const int8_t& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator<< (const int16_t& val)
|
bufferstream &bufferstream::operator<< (const int16_t &val)
|
||||||
{
|
{
|
||||||
writeType<int16_t>(val);
|
writeType<int16_t>(val);
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -206,7 +206,7 @@ bufferstream& bufferstream::operator<< (const int16_t& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator<< (const int32_t& val)
|
bufferstream &bufferstream::operator<< (const int32_t &val)
|
||||||
{
|
{
|
||||||
writeType<int32_t>(val);
|
writeType<int32_t>(val);
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -218,7 +218,7 @@ bufferstream& bufferstream::operator<< (const int32_t& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator<< (const int64_t& val)
|
bufferstream &bufferstream::operator<< (const int64_t &val)
|
||||||
{
|
{
|
||||||
writeType<int64_t>(val);
|
writeType<int64_t>(val);
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -230,7 +230,7 @@ bufferstream& bufferstream::operator<< (const int64_t& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator<< (const uint8_t& val)
|
bufferstream &bufferstream::operator<< (const uint8_t &val)
|
||||||
{
|
{
|
||||||
writeType<uint8_t>(val);
|
writeType<uint8_t>(val);
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -242,7 +242,7 @@ bufferstream& bufferstream::operator<< (const uint8_t& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator<< (const uint16_t& val)
|
bufferstream &bufferstream::operator<< (const uint16_t &val)
|
||||||
{
|
{
|
||||||
writeType<uint16_t>(val);
|
writeType<uint16_t>(val);
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -254,7 +254,7 @@ bufferstream& bufferstream::operator<< (const uint16_t& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator<< (const uint32_t& val)
|
bufferstream &bufferstream::operator<< (const uint32_t &val)
|
||||||
{
|
{
|
||||||
writeType<uint32_t>(val);
|
writeType<uint32_t>(val);
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -266,7 +266,7 @@ bufferstream& bufferstream::operator<< (const uint32_t& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator<< (const uint64_t& val)
|
bufferstream &bufferstream::operator<< (const uint64_t &val)
|
||||||
{
|
{
|
||||||
writeType<uint64_t>(val);
|
writeType<uint64_t>(val);
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -278,7 +278,7 @@ bufferstream& bufferstream::operator<< (const uint64_t& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator>> (float& val)
|
bufferstream &bufferstream::operator>> (float &val)
|
||||||
{
|
{
|
||||||
val = readType<float>();
|
val = readType<float>();
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -290,7 +290,7 @@ bufferstream& bufferstream::operator>> (float& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator>> (double& val)
|
bufferstream &bufferstream::operator>> (double &val)
|
||||||
{
|
{
|
||||||
val = readType<double>();
|
val = readType<double>();
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -302,7 +302,7 @@ bufferstream& bufferstream::operator>> (double& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator<< (const float& val)
|
bufferstream &bufferstream::operator<< (const float &val)
|
||||||
{
|
{
|
||||||
writeType<float>(val);
|
writeType<float>(val);
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -314,7 +314,7 @@ bufferstream& bufferstream::operator<< (const float& val)
|
||||||
* @param val
|
* @param val
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator<< (const double& val)
|
bufferstream &bufferstream::operator<< (const double &val)
|
||||||
{
|
{
|
||||||
writeType<double>(val);
|
writeType<double>(val);
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -326,7 +326,7 @@ bufferstream& bufferstream::operator<< (const double& val)
|
||||||
* @param obj
|
* @param obj
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator>> (streamable& obj)
|
bufferstream &bufferstream::operator>> (streamable &obj)
|
||||||
{
|
{
|
||||||
obj.iStream(shared_from_this());
|
obj.iStream(shared_from_this());
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -338,7 +338,7 @@ bufferstream& bufferstream::operator>> (streamable& obj)
|
||||||
* @param obj
|
* @param obj
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bufferstream& bufferstream::operator<< (const streamable& obj)
|
bufferstream &bufferstream::operator<< (const streamable &obj)
|
||||||
{
|
{
|
||||||
obj.oStream(shared_from_this());
|
obj.oStream(shared_from_this());
|
||||||
return *this;
|
return *this;
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -48,41 +48,41 @@ public:
|
||||||
|
|
||||||
// input sequence
|
// input sequence
|
||||||
uint32_t available();
|
uint32_t available();
|
||||||
uint8_t * data();
|
uint8_t *data();
|
||||||
|
|
||||||
// output sequence
|
// output sequence
|
||||||
uint32_t size();
|
uint32_t size();
|
||||||
uint8_t * base();
|
uint8_t *base();
|
||||||
|
|
||||||
// unsigned integer
|
// unsigned integer
|
||||||
bufferstream& operator>> (uint8_t& val);
|
bufferstream &operator>> (uint8_t &val);
|
||||||
bufferstream& operator>> (uint16_t& val);
|
bufferstream &operator>> (uint16_t &val);
|
||||||
bufferstream& operator>> (uint32_t& val);
|
bufferstream &operator>> (uint32_t &val);
|
||||||
bufferstream& operator>> (uint64_t& val);
|
bufferstream &operator>> (uint64_t &val);
|
||||||
bufferstream& operator<< (const uint8_t& val);
|
bufferstream &operator<< (const uint8_t &val);
|
||||||
bufferstream& operator<< (const uint16_t& val);
|
bufferstream &operator<< (const uint16_t &val);
|
||||||
bufferstream& operator<< (const uint32_t& val);
|
bufferstream &operator<< (const uint32_t &val);
|
||||||
bufferstream& operator<< (const uint64_t& val);
|
bufferstream &operator<< (const uint64_t &val);
|
||||||
|
|
||||||
// signed integer
|
// signed integer
|
||||||
bufferstream& operator>> (int8_t& val);
|
bufferstream &operator>> (int8_t &val);
|
||||||
bufferstream& operator>> (int16_t& val);
|
bufferstream &operator>> (int16_t &val);
|
||||||
bufferstream& operator>> (int32_t& val);
|
bufferstream &operator>> (int32_t &val);
|
||||||
bufferstream& operator>> (int64_t& val);
|
bufferstream &operator>> (int64_t &val);
|
||||||
bufferstream& operator<< (const int8_t& val);
|
bufferstream &operator<< (const int8_t &val);
|
||||||
bufferstream& operator<< (const int16_t& val);
|
bufferstream &operator<< (const int16_t &val);
|
||||||
bufferstream& operator<< (const int32_t& val);
|
bufferstream &operator<< (const int32_t &val);
|
||||||
bufferstream& operator<< (const int64_t& val);
|
bufferstream &operator<< (const int64_t &val);
|
||||||
|
|
||||||
// floating point
|
// floating point
|
||||||
bufferstream& operator>> (float& val);
|
bufferstream &operator>> (float &val);
|
||||||
bufferstream& operator>> (double& val);
|
bufferstream &operator>> (double &val);
|
||||||
bufferstream& operator<< (const float& val);
|
bufferstream &operator<< (const float &val);
|
||||||
bufferstream& operator<< (const double& val);
|
bufferstream &operator<< (const double &val);
|
||||||
|
|
||||||
// stream objects
|
// stream objects
|
||||||
bufferstream& operator>> (streamable& obj);
|
bufferstream &operator>> (streamable &obj);
|
||||||
bufferstream& operator<< (const streamable& obj);
|
bufferstream &operator<< (const streamable &obj);
|
||||||
|
|
||||||
// strings
|
// strings
|
||||||
void readString(std::string& str, const int fixed_length = 0, const bool terminated = true);
|
void readString(std::string& str, const int fixed_length = 0, const bool terminated = true);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user