Skip to content

Commit 96ccdf7

Browse files
committed
#210-remove string_views stuff.
Completed. Validated.
1 parent 5aa3489 commit 96ccdf7

File tree

2 files changed

+8
-29
lines changed

2 files changed

+8
-29
lines changed

cpp-strings-tests/cpp-strings-tests.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@ namespace cppstringstests
2323
Assert::AreEqual(wabcd.c_str(), CppWString(wabcd).c_str());
2424
}
2525

26-
TEST_METHOD(_csv)
27-
{
28-
using namespace pcs;
29-
auto abcd = "abcD"csv;
30-
auto wabcd = L"abcD"csv;
31-
Assert::AreEqual(abcd.c_str(), CppString(abcd).c_str());
32-
Assert::AreEqual(wabcd.c_str(), CppWString(wabcd).c_str());
33-
}
34-
3526
TEST_METHOD(is_alpha)
3627
{
3728
for (int ch = 0; ch <= 255; ++ch)
@@ -3063,7 +3054,7 @@ namespace cppstringstests
30633054
Assert::AreEqual(pcs::CppWString(L"abcd##efg").c_str(), ws.join(pcs::CppWString(L"abcd"), pcs::CppWString(L"efg")).c_str());
30643055
Assert::AreEqual(pcs::CppWString(L"abcd##efg##123456789").c_str(), ws.join(pcs::CppWString(L"abcd"), pcs::CppWString(L"efg"), pcs::CppWString(L"123456789")).c_str());
30653056
Assert::AreEqual(pcs::CppWString(L"abcd##efg##123456789##0").c_str(), ws.join(L"abcd"cs, L"efg"cs, L"123456789"cs, L"0"cs).c_str());
3066-
Assert::AreEqual(pcs::CppWString(L"abcd# #efg# #123456789# #0").c_str(), L"# #"csv.join(L"abcd", L"efg"cs, L"123456789"cs, L"0"cs).c_str());
3057+
Assert::AreEqual(pcs::CppWString(L"abcd# #efg# #123456789# #0").c_str(), L"# #"cs.join(L"abcd", L"efg"cs, L"123456789"cs, L"0"cs).c_str());
30673058
Assert::AreEqual(pcs::CppWString(L"abcdE").c_str(), L"##"cs.join(L"abcdE").c_str());
30683059
Assert::AreEqual(pcs::CppWString(L"##").c_str(), L"##"cs.join().c_str());
30693060
Assert::AreEqual(pcs::CppWString(L"").c_str(), L"##"cs.join(L"").c_str());

cpp-strings/cppstrings.h

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include <ranges>
3333
#include <span>
3434
#include <stdexcept>
35-
#include <string_view>
35+
//#include <string_view>
3636
#include <type_traits>
3737
#include <vector>
3838

@@ -85,11 +85,11 @@ namespace pcs // i.e. "pythonic c++ strings"
8585

8686

8787
// litteral operators
88+
#pragma warning(push)
8889
#pragma warning(disable: 4455)
8990
inline CppString operator""cs(const char* str, std::size_t len); //!< Forms a CppString literal.
90-
inline CppString operator""csv(const char* str, std::size_t len); //!< Forms a CppString view literal.
9191
inline CppWString operator""cs(const wchar_t* str, std::size_t len); //!< Forms a CppWString literal.
92-
inline CppWString operator""csv(const wchar_t* str, std::size_t len); //!< Forms a CppWString view literal.
92+
#pragma warning(pop)
9393

9494
// chars classifications -- not to be directly called, see respective specializations at the very end of this module.
9595
template<class CharT>
@@ -163,7 +163,6 @@ namespace pcs // i.e. "pythonic c++ strings"
163163
public:
164164
//=== Wrappers ========================================
165165
using MyBaseClass = std::basic_string<CharT, TraitsT, AllocatorT>;
166-
using MyStringView = std::basic_string_view<CharT, TraitsT>;
167166

168167
using traits_type = MyBaseClass::traits_type;
169168
using value_type = MyBaseClass::value_type;
@@ -330,7 +329,7 @@ namespace pcs // i.e. "pythonic c++ strings"
330329
* character in key is associated in the translation table with
331330
* the i-th character in values.
332331
*/
333-
/** /
332+
/**/
334333
template<class StringViewLike>
335334
explicit TransTable(const StringViewLike& keys, const StringViewLike& values)
336335
{
@@ -2032,31 +2031,20 @@ namespace pcs // i.e. "pythonic c++ strings"
20322031

20332032

20342033
//===== litteral operators ============================
2034+
#pragma warning(push)
2035+
#pragma warning(disable: 4455)
20352036
/** \brief Forms a CppString literal. */
20362037
inline CppString operator""cs(const char* str, std::size_t len)
20372038
{
20382039
return CppString(CppString::MyBaseClass(str, len));
20392040
}
20402041

2041-
/** \brief Forms a CppString view literal. */
2042-
inline CppString operator""csv(const char* str, std::size_t len)
2043-
{
2044-
//return CppString(CppString::MyStringView(str, len));
2045-
return CppString(str, len);
2046-
}
2047-
20482042
/** \brief Forms a CppWString literal. */
20492043
inline CppWString operator""cs(const wchar_t* str, std::size_t len)
20502044
{
20512045
return CppWString(CppWString::MyBaseClass(str, len));
20522046
}
2053-
2054-
/** \brief Forms a CppWString view literal. */
2055-
inline CppWString operator""csv(const wchar_t* str, std::size_t len)
2056-
{
2057-
//return CppWString(CppWString::MyStringView(str, len));
2058-
return CppWString(str, len);
2059-
}
2047+
#pragma warning(pop)
20602048

20612049

20622050
//===== templated chars classes ===========================

0 commit comments

Comments
 (0)