bool StoreBlob::readRaw(ConnectionReader& reader) { std::int32_t len = reader.expectInt32(); x.resize(len); reader.expectBlock(const_cast<char*>(x.data()), len); return true; }
bool Storable::read(ConnectionReader& connection) { std::int32_t x = connection.expectInt32(); if (x != getCode()) { return false; } return readRaw(connection); }
bool Value::read(ConnectionReader& connection) { if (proxy) { delete proxy; proxy = nullptr; } std::int32_t x = connection.expectInt32(); if ((x&0xffff) != x) return false; if (!(x&BOTTLE_TAG_LIST)) return false; std::int32_t len = connection.expectInt32(); if (len==0) return true; if (len!=1) return false; if (x==BOTTLE_TAG_LIST) { x = connection.expectInt32(); } else { x &= ~BOTTLE_TAG_LIST; } if (connection.isError()) return false; Storable *s = Storable::createByCode(x); setProxy(s); if (!proxy) return false; return s->readRaw(connection); }
bool StoreString::readRaw(ConnectionReader& reader) { std::int32_t len = reader.expectInt32(); x.resize(len); reader.expectBlock(const_cast<char*>(x.data()), len); #ifndef YARP_NO_DEPRECATED // Since YARP 2.3.72 // This is needed for compatibility with versions of yarp before March 2015 if (len > 0) { if (x[len - 1] == '\0') { x.resize(len-1); } } #endif // YARP_NO_DEPRECATED return true; }
bool StoreVocab::readRaw(ConnectionReader& reader) { x = reader.expectInt32(); return true; }