MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / string get

Method string get

3rdparty/cppzmq/zmq.hpp:1857–1881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1855 // i.e. the string size excludes the null character.
1856 template<int Opt, int NullTerm>
1857 ZMQ_NODISCARD std::string get(sockopt::array_option<Opt, NullTerm>,
1858 size_t init_size = 1024) const
1859 {
1860 if ZMQ_CONSTEXPR_IF (NullTerm == 2) {
1861 if (init_size == 1024) {
1862 init_size = 41; // get as Z85 string
1863 }
1864 }
1865 std::string str(init_size, '\0');
1866 size_t size = get(sockopt::array_option<Opt>{}, buffer(str));
1867 if ZMQ_CONSTEXPR_IF (NullTerm == 1) {
1868 if (size > 0) {
1869 assert(str[size - 1] == '\0');
1870 --size;
1871 }
1872 } else if ZMQ_CONSTEXPR_IF (NullTerm == 2) {
1873 assert(size == 32 || size == 41);
1874 if (size == 41) {
1875 assert(str[size - 1] == '\0');
1876 --size;
1877 }
1878 }
1879 str.resize(size);
1880 return str;
1881 }
1882#endif
1883
1884 void bind(std::string const &addr) { bind(addr.c_str()); }

Callers

nothing calls this directly

Calls 2

bufferFunction · 0.85
getFunction · 0.70

Tested by

no test coverage detected