Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
090b04c
#77 - Create a unit test solution in a new branch dev/tests
schmouk Mar 17, 2023
0bddd1f
#77 - Create a unit test solution in a new branch dev/tests
schmouk Mar 18, 2023
516d824
#78 - Test pcs::is_alpha() for char and wchar_t
schmouk Mar 18, 2023
11e0bb7
#79 - Test pcs::is_ascii() for char and wchar_t
schmouk Mar 18, 2023
23f2290
#80 - Test pcs::is_decimal() for char and wchar_t
schmouk Mar 18, 2023
b4f6791
#81 - Test pcs::is_id_continue() for char and wchar_t
schmouk Mar 18, 2023
7964ace
#82 - Test pcs::is_id_start() for char and wchar_t
schmouk Mar 18, 2023
6edec7a
#83 - Test pcs::is_lower() for char and wchar_t
schmouk Mar 18, 2023
aa12293
84 - Test pcs::is_printable() for char and wchar_t
schmouk Mar 18, 2023
d0a6f1c
#85 - Test pcs::is_punctuation() for char and wchar_t
schmouk Mar 18, 2023
0eacd20
#86 - Test pcs::is_space() for char and wchar_t
schmouk Mar 18, 2023
0575557
#87 - Test pcs::is_upper() for char and wchar_t
schmouk Mar 18, 2023
2d6e5cd
#88 - Test pcs::swap_case() for char and wchar_t
schmouk Mar 18, 2023
060d0e6
#89 - Test pcs::to_lower() for char and wchar_t
schmouk Mar 18, 2023
d4d697b
#90 - Test pcs::to_upper() for char and wchar_t
schmouk Mar 18, 2023
37f45be
#91 - Test pcs::operator""cs for char and wchar_t
schmouk Mar 18, 2023
435385f
#92 - Test pcs::operator""csv for char and wchar_t
schmouk Mar 18, 2023
345ed73
#93 - Test CppStringT::TransTable constructor #1 with char and wchar_t
schmouk Mar 18, 2023
166e6e2
#94 - Test CppStringT::TransTable constructor #2 with char and wchar_t
schmouk Mar 18, 2023
151260c
#95 - Test CppStringT::TransTable constructor #3 with char and wchar_t
schmouk Mar 18, 2023
7f12c48
#96 - Test CppStringT::TransTable constructor #4 with char and wchar_t
schmouk Mar 18, 2023
61cdb2e
#97 - Test CppStringT::TransTable constructor #5 with char and wchar_t
schmouk Mar 18, 2023
59d8d80
#98 - Test CppStringT::TransTable constructor #6 with char and wchar_t
schmouk Mar 18, 2023
adde769
#99 - Test CppStringT::TransTable constructor #7 with char and wchar_t
schmouk Mar 18, 2023
6e166c8
#100 - Test CppStringT::TransTable constructor #8 with char and wchar_t
schmouk Mar 19, 2023
de72dc6
#101 - Test CppStringT::TransTable constructor #9 with char and wchar_t
schmouk Mar 19, 2023
e861148
#104 - Test CppStringT::TransTable empty constructor with char and wc…
schmouk Mar 19, 2023
4d1fa4d
#105 - Test CppStringT::TransTable copy constructor with char and wch…
schmouk Mar 19, 2023
320109e
#106 - Test CppStringT::TransTable move constructor with char and wch…
schmouk Mar 19, 2023
8a94ae4
#107 - Test CppStringT::TransTable copy assignment with char and wchar_t
schmouk Mar 19, 2023
755de78
#108 - Test CppStringT::TransTable move assignment with char and wchar_t
schmouk Mar 19, 2023
e67fa5a
#109 - Test CppStringT::TransTable std::map-assignment with char and …
schmouk Mar 19, 2023
b9efdfe
#110 - Test CppStringT::TransTable::operator[] with char and wchar_t
schmouk Mar 19, 2023
31399dd
#111 - Test CppStringT empty constructor with char and wchar_t
schmouk Mar 19, 2023
8b862ac
#112 - Test CppStringT copy constructor with char and wchar_t
schmouk Mar 19, 2023
8ada1a9
#113 - Test CppStringT move constructor with char and wchar_t
schmouk Mar 19, 2023
f39c9aa
#114 - Test CppStringT constructor #6 with char and wchar_t
schmouk Mar 19, 2023
ab90c70
#115 - Test CppStringT constructor #7 with char and wchar_t
schmouk Mar 19, 2023
8893fd5
#116 - Test CppStringT constructor #8 with char and wchar_t
schmouk Mar 19, 2023
c6268ec
#117 - Test CppStringT constructor #9 with char and wchar_t
schmouk Mar 19, 2023
fb662fc
#118 - Test CppStringT constructor #10 with char and wchar_t
schmouk Mar 19, 2023
ceebe19
#119 - Test CppStringT constructor #11 with char and wchar_t
schmouk Mar 19, 2023
b02b516
#120 - Test CppStringT constructor #12 with char and wchar_t
schmouk Mar 19, 2023
cf190aa
#121 - Test CppStringT constructor #13 with char and wchar_t
schmouk Mar 19, 2023
6c41fde
#122 - Test CppStringT constructor #14 with char and wchar_t
schmouk Mar 19, 2023
487b5cc
#123 - Test CppStringT constructor #15 with char and wchar_t
schmouk Mar 19, 2023
401945c
#124 - Test CppStringT constructor #16 with char and wchar_t
schmouk Mar 19, 2023
e53011d
#179 - Test CppStringT constructor #19 with char and wchar_t
schmouk Mar 19, 2023
b1c2abc
#127 - Test CppStringT::capitalize() with char and wchar_t
schmouk Mar 19, 2023
9814e6d
#128 - Test CppStringT::center() with char and wchar_t
schmouk Mar 19, 2023
a54feb6
#129 - Test CppStringT::count() with char and wchar_t
schmouk Mar 19, 2023
97f6bb1
#130 - Test CppStringT::count_n() with char and wchar_t
schmouk Mar 19, 2023
33b1083
#131 - Test CppStringT::ends_with() with char and wchar_t
schmouk Mar 19, 2023
ef16d45
#132 - Test CppStringT::ends_with_n() with char and wchar_t
schmouk Mar 19, 2023
acd45ac
#133 - Test CppStringT::expand_tabs() with char and wchar_t
schmouk Mar 19, 2023
fb4586d
#186 - Implement new signatures for method CppStringT::find()
schmouk Mar 20, 2023
1c6ce39
#187 - Implement new signatures for CppStringT::find_n()
schmouk Mar 20, 2023
63bcf2a
#187 - Implement new signatures for CppStringT::find_n()
schmouk Mar 20, 2023
cc418b2
#134 - Test CppStringT::find() with char and wchar_t
schmouk Mar 20, 2023
7636c39
#135 - Test CppStringT::find_n() with char and wchar_t
schmouk Mar 20, 2023
403a87c
#190 - Implement new signatures for method CppStringT::index()
schmouk Mar 21, 2023
e9bbcdd
#136 - Test CppStringT::index() with char and wchar_t
schmouk Mar 21, 2023
951d497
#191 - Implement new signatures for method CppStringT::index_n()
schmouk Mar 21, 2023
a12477b
#137 - Test CppStringT::index_n() with char and wchar_t
schmouk Mar 21, 2023
4ec3564
#138 - Test CppStringT::isalnum() with char and wchar_t
schmouk Mar 21, 2023
3fdad29
#139 - Test CppStringT::isalpha() with char and wchar_t
schmouk Mar 21, 2023
4dc817f
#140 - Test CppStringT::isascii() with char and wchar_t
schmouk Mar 21, 2023
f4588b8
#141 - Test CppStringT::isdecimal() with char and wchar_t
schmouk Mar 21, 2023
b981f6a
#142 - Test CppStringT::isdigit() with char and wchar_t
schmouk Mar 21, 2023
2c3c035
#145 - Test CppStringT::isnumeric() with char and wchar_t
schmouk Mar 21, 2023
177811d
#143 - Test CppStringT::isidentifier() with char and wchar_t
schmouk Mar 22, 2023
365319f
#144 - Test CppStringT::islower() with char and wchar_t
schmouk Mar 22, 2023
33f809f
#146 - Test CppStringT::isprintable() with char and wchar_t
schmouk Mar 22, 2023
740ee0f
#147 - Test CppStringT::ispunctuation() with char and wchar_t
schmouk Mar 22, 2023
7ca47c7
#148 - Test CppStringT::isspace() with char and wchar_t
schmouk Mar 22, 2023
b1c0e4c
#149 - Test CppStringT::istitle() with char and wchar_t
schmouk Mar 22, 2023
474642e
#150 - Test CppStringT::isupper() with char and wchar_t
schmouk Mar 22, 2023
43f92f7
#151 - Test CppStringT::is_words_sep() with char and wchar_t
schmouk Mar 22, 2023
aba3db6
#152 - Test `CppStringT::join()` with `char` and `wchar_t`
schmouk May 12, 2023
383adcd
#153 - Test CppStringT::ljust() with char and wchar_t
schmouk May 12, 2023
78c5ebc
#154 - Test CppStringT::lower() with char and wchar_t
schmouk May 12, 2023
c7a867b
#155 - Test CppStringT::lstrip() with char and wchar_t
schmouk May 13, 2023
98a85fb
#156 - Test CppStringT::partition() with char and wchar_t
schmouk May 13, 2023
e85bfc9
#157 - Test CppStringT::removeprefix() with char and wchar_t
schmouk May 13, 2023
6faba8d
#158 - Test CppStringT::removesuffix() with char and wchar_t
schmouk May 13, 2023
56b7326
#159 - Test CppStringT::replace() with char and wchar_t
schmouk Nov 27, 2023
2c30532
#160 - Test CppStringT::rfind() with char and wchar_t
schmouk Nov 28, 2023
6ff8a0f
#196 - Extend and fix tests on find() and index() methods
schmouk Dec 2, 2023
cbcaae5
#161 - Test CppStringT::rfind_n() with char and wchar_t
schmouk Dec 5, 2023
db2e408
#199-refactor tests
schmouk Jul 7, 2025
866069a
#162-Test CppStringT::rindex() with char and wchar_t
schmouk Jul 7, 2025
beafb01
#163-Test CppStringT::rindex_n() with char and wchar_t
schmouk Jul 7, 2025
8b5c5b9
#163-Test CppStringT::rindex_n() with char and wchar_t
schmouk Jul 7, 2025
e3cf5e3
#164-Test CppStringT::rjust() with char and wchar_t
schmouk Jul 7, 2025
37d0dc8
#164-Test CppStringT::rjust() with char and wchar_t
schmouk Jul 7, 2025
96f452c
#165-Test CppStringT::rpartition() with char and wchar_t
schmouk Jul 7, 2025
1062816
#165-Test CppStringT::rpartition() with char and wchar_t
schmouk Jul 7, 2025
80c3288
#166-Test CppStringT::rsplit() with char and wchar_t
schmouk Jul 9, 2025
19d9688
#166-Test CppStringT::rsplit() with char and wchar_t
schmouk Jul 9, 2025
f1f476b
#167-Test CppStringT::rstrip() with char and wchar_t
schmouk Jul 9, 2025
c892008
#168-Test CppStringT::split() with char and wchar_t
schmouk Jul 9, 2025
90d8397
#169-Test CppStringT::splitlines() with char and wchar_t
schmouk Jul 10, 2025
446cb8e
#200-modify .ignore and VS projects to compile and test 32-bits platf…
schmouk Jul 10, 2025
a11502e
#170-Test CppStringT::startswith() with char and wchar_t
schmouk Jul 10, 2025
9005fb0
#171-Test CppStringT::startswith_n() with char and wchar_t
schmouk Jul 10, 2025
6575060
#172-Test CppStringT::strip() with char and wchar_t
schmouk Jul 10, 2025
41860e7
#173-Test CppStringT::substr() with char and wchar_t
schmouk Jul 10, 2025
ce29faf
#174-Test CppStringT::swapcase() with char and wchar_t
schmouk Jul 11, 2025
52404a8
#175-Test CppStringT::title() with char and wchar_t
schmouk Jul 11, 2025
f95e30f
#176-Test CppStringT::translate() with char and wchar_t
schmouk Jul 11, 2025
aa60e6a
#177-Test CppStringT::upper() with char and wchar_t
schmouk Jul 11, 2025
e3ff5ce
#178-Test CppStringT::zfill() with char and wchar_t
schmouk Jul 11, 2025
7588cb6
#202-add test on nullptr in CppStringT pointer constructors
schmouk Jul 11, 2025
873d6d1
#182-Implement method CppStringT::contains()
schmouk Jul 11, 2025
60f5163
#184-Test method CppStringT::contains()
schmouk Jul 11, 2025
c269f62
#183-Implement method CppStringT::contains_n()
schmouk Jul 11, 2025
016bdfd
#183-Implement method CppStringT::contains_n()
schmouk Jul 11, 2025
fbde103
#185-Test method CppStringT::contains_n()
schmouk Jul 11, 2025
20c35e8
#180-Implement CppStringT::operator* ()
schmouk Jul 11, 2025
1559542
#181-Test CppStringT::operator* ()
schmouk Jul 11, 2025
042fcca
#203-remove signatures with c-strings and chars
schmouk Jul 11, 2025
83f468c
#208-implement slices
schmouk Jul 12, 2025
43f4bbd
#208-implement slices
schmouk Jul 12, 2025
3f25a77
#209-test slices
schmouk Jul 13, 2025
f512977
#194-Implement operator () with slices
schmouk Jul 13, 2025
5aa3489
#195-Test operator () with slices
schmouk Jul 13, 2025
96ccdf7
#210-remove string_views stuff.
schmouk Jul 13, 2025
b3dc949
#211-fix c++ and c standards for every projects, configurations and p…
schmouk Jul 13, 2025
e986ede
#18-Implement method CppStringT::format()
schmouk Jul 13, 2025
18f4f7d
#18-Implement method CppStringT::format()
schmouk Jul 15, 2025
bccb85b
#205-test method CppStringT::format()
schmouk Jul 15, 2025
2074216
#217-set VS project to c++20 and c17
schmouk Jul 15, 2025
6110a76
#207-Add namespace pcs when missing in tests
schmouk Jul 15, 2025
b9ae59c
#206-fix missing \briefs in doxygen strings
schmouk Jul 15, 2025
2ee7546
#212-add attribute [[nodiscard]] at any useful place
schmouk Jul 15, 2025
2348d3c
#219-modify copyright dates
schmouk Jul 15, 2025
19d3913
#213-add attribute [[likely]] and [[unlikely]]
schmouk Jul 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@
# Visual Studio specifics
.vs
x64
Debug
Release

# CppStrings specifics
archive
5,695 changes: 5,695 additions & 0 deletions cpp-strings-tests/cpp-strings-tests.cpp

Large diffs are not rendered by default.

188 changes: 188 additions & 0 deletions cpp-strings-tests/cpp-strings-tests.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<ProjectGuid>{3B180A14-A496-4E9D-8D9B-57D871C8E005}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>cppstringstests</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectSubType>NativeUnitTestProject</ProjectSubType>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;$(ProjectDir)..\cpp-strings</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<LanguageStandard>stdcpplatest</LanguageStandard>
<LanguageStandard_C>stdclatest</LanguageStandard_C>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableModules>false</EnableModules>
<PrecompiledHeaderOutputFile />
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;$(ProjectDir)..\cpp-strings</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<LanguageStandard>stdcpplatest</LanguageStandard>
<LanguageStandard_C>stdclatest</LanguageStandard_C>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableModules>false</EnableModules>
<PrecompiledHeaderOutputFile />
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;$(ProjectDir)..\cpp-strings</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<LanguageStandard>stdcpplatest</LanguageStandard>
<LanguageStandard_C>stdclatest</LanguageStandard_C>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableModules>false</EnableModules>
<PrecompiledHeaderOutputFile />
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;$(ProjectDir)..\cpp-strings</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<LanguageStandard>stdcpplatest</LanguageStandard>
<LanguageStandard_C>stdclatest</LanguageStandard_C>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<EnableModules>false</EnableModules>
<PrecompiledHeaderOutputFile />
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="cpp-strings-tests.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
22 changes: 22 additions & 0 deletions cpp-strings-tests/cpp-strings-tests.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="cpp-strings-tests.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
6 changes: 6 additions & 0 deletions cpp-strings-tests/cpp-strings-tests.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>true</ShowAllFiles>
</PropertyGroup>
</Project>
10 changes: 10 additions & 0 deletions cpp-strings/cpp-strings.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ VisualStudioVersion = 17.5.33414.496
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-strings", "cpp-strings.vcxproj", "{520980FD-2242-443E-89DB-B8E41D9606B5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpp-strings-tests", "..\cpp-strings-tests\cpp-strings-tests.vcxproj", "{3B180A14-A496-4E9D-8D9B-57D871C8E005}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand All @@ -21,6 +23,14 @@ Global
{520980FD-2242-443E-89DB-B8E41D9606B5}.Release|x64.Build.0 = Release|x64
{520980FD-2242-443E-89DB-B8E41D9606B5}.Release|x86.ActiveCfg = Release|Win32
{520980FD-2242-443E-89DB-B8E41D9606B5}.Release|x86.Build.0 = Release|Win32
{3B180A14-A496-4E9D-8D9B-57D871C8E005}.Debug|x64.ActiveCfg = Debug|x64
{3B180A14-A496-4E9D-8D9B-57D871C8E005}.Debug|x64.Build.0 = Debug|x64
{3B180A14-A496-4E9D-8D9B-57D871C8E005}.Debug|x86.ActiveCfg = Debug|Win32
{3B180A14-A496-4E9D-8D9B-57D871C8E005}.Debug|x86.Build.0 = Debug|Win32
{3B180A14-A496-4E9D-8D9B-57D871C8E005}.Release|x64.ActiveCfg = Release|x64
{3B180A14-A496-4E9D-8D9B-57D871C8E005}.Release|x64.Build.0 = Release|x64
{3B180A14-A496-4E9D-8D9B-57D871C8E005}.Release|x86.ActiveCfg = Release|Win32
{3B180A14-A496-4E9D-8D9B-57D871C8E005}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
17 changes: 13 additions & 4 deletions cpp-strings/cpp-strings.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<EnableModules>false</EnableModules>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -90,6 +93,9 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<EnableModules>false</EnableModules>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -104,9 +110,10 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<EnableModules>true</EnableModules>
<EnableModules>false</EnableModules>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -121,9 +128,10 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpplatest</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<EnableModules>true</EnableModules>
<EnableModules>false</EnableModules>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -136,6 +144,7 @@
<ClCompile Include="cppstrings.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="archive\cppstrings.h" />
<ClInclude Include="cppstrings.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
12 changes: 9 additions & 3 deletions cpp-strings/cppstrings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Library cppstrings
"What if c++ strings where as easy to use as Python strings?"

Copyright (C) 2023 Philippe Schmouker
Copyright (C) 2023-2025 Philippe Schmouker
contact - ph (dot) schmouker (at) gmail (dot) com

This program is free software: you can redistribute it and/or modify
Expand All @@ -29,11 +29,17 @@ using namespace pcs;
*/
int main()
{
CppString s = "-5.1";
CppWString ws{ L"-5.2"cs };
CppString s = "-5.1"_cs;
CppWString ws{ L"-5.2"_cs };

std::cout << ws.isupper() << std::endl;
std::cout << s.zfill(10).c_str() << std::endl;

s.format("{} {}", 1, 3.14);
ws.format(L"{} abc", 2);

std::cout << s.c_str() << " / ";
std::wcout << ws.c_str() << std::endl;

return 0;
}
Loading