bool const operator>(CMyString const& a, CMyString const& b) { int const result = memcmp(a.GetStringData(), b.GetStringData(), min(a.GetLength(), b.GetLength())); if (result != 0) { return (result > 0); } return (a.GetLength() > b.GetLength()); }
void VerifyCorrectWorkIstreamOperator(std::string const &str) { std::istringstream strm(str); CMyString myStr; strm >> myStr; BOOST_CHECK_EQUAL(myStr.GetStringData(), str); }
void ExpectStringDataImpl(const CMyString & s, const char *data, size_t size) { BOOST_REQUIRE_EQUAL(s.GetLength(), size - 1); BOOST_REQUIRE_EQUAL(s.GetStringData(), data); BOOST_REQUIRE_EQUAL(memcmp(s.GetStringData(), data, size), 0); }
void VerifyString(CMyString const & str, size_t length, std::string const & reference) { BOOST_CHECK_EQUAL(str.GetLength(), length); BOOST_CHECK_EQUAL(str.GetStringData(), reference); }
CMyString::CMyString(CMyString const & other) : CMyString(other.GetStringData(), other.GetLength()) { }