Data& Data::setToken(std::string token) { m_token = makeStringBlock(tlv::Token, token); m_wire.reset(); return *this; // if (m_wire.hasWire() && m_token.value_size() > 0) { // std::memcpy(const_cast<uint8_t*>(m_token.value()), &(token.c_str()), strlen(token.c_str())); // } // else { // m_token = makeBinaryBlock(tlv::Token, // reinterpret_cast<const uint8_t*>(&(token.c_str())), // strlen(token.c_str())); // m_wire.reset(); // } // return *this; }
Component::Component(const std::string& str) : Block(makeStringBlock(tlv::GenericNameComponent, str)) { }