Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: C++ CI

on:
push:
branches: [main, feature/production-grade-mystring]
pull_request:
branches: [main]

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug

- name: Build
run: cmake --build build --parallel

- name: Test
run: ctest --test-dir build --output-on-failure

- name: Sanitizer build
run: |
cmake -S . -B build-asan -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer"
cmake --build build-asan --parallel
ctest --test-dir build-asan --output-on-failure
25 changes: 14 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# Build files
*.exe
*.out
# Build artifacts
build/
build-*/
CMakeFiles/
CMakeCache.txt
cmake_install.cmake
Makefile
*.o
*.obj
*.out
*.exe

# Visual Studio Code
# IDE files
.vscode/
.idea/
*.user
*.suo

# Debug files
# Debug / compiler artifacts
*.pdb
*.ilk

# CMake
CMakeFiles/
CMakeCache.txt
cmake_install.cmake
Makefile
24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.16)

project(MyString VERSION 1.0.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

add_library(mystring src/MyString.cpp)
target_include_directories(mystring PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_compile_options(mystring PRIVATE
$<$<CXX_COMPILER_ID:GNU,Clang>:-Wall;-Wextra;-Wpedantic>
$<$<CXX_COMPILER_ID:MSVC>:/W4>
)

add_executable(mystring_demo examples/main.cpp)
target_link_libraries(mystring_demo PRIVATE mystring)

include(CTest)
if(BUILD_TESTING)
add_executable(mystring_tests tests/test_mystring.cpp)
target_link_libraries(mystring_tests PRIVATE mystring)
add_test(NAME MyStringTests COMMAND mystring_tests)
endif()
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Jyatin Kumar Singh

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
100 changes: 0 additions & 100 deletions Main.cpp

This file was deleted.

Loading
Loading