Skip to content

Commit cc27c17

Browse files
Update README.md to agree with recent changes
1 parent 108428d commit cc27c17

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ target_link_libraries(YourExecutable ${CPP_SAFE_IO})
3131
...
3232
```
3333

34-
> [!NOTE]
35-
> This approach is used by this project's ```tests``` directory.
36-
3734
Nonetheless, I highly recommend making use of a second, cleaner approach where you don't have to directly include the library as one of your project's subdirectories:
3835

3936
> [!IMPORTANT]
@@ -49,7 +46,7 @@ include(FetchContent)
4946
5047
FetchContent_Declare( cppsafeio
5148
GIT_REPOSITORY https://github.com/DanielRamirez404/CppSafeIO.git
52-
GIT_TAG v2.0.0
49+
GIT_TAG v2.1.0
5350
GIT_SHALLOW TRUE
5451
)
5552
@@ -63,6 +60,13 @@ target_link_libraries(YourExecutable ${CPP_SAFE_IO})
6360
> [!NOTE]
6461
> You can optionally change the value of the ```CPP_SAFE_IO``` variable before the ```FetchContent_MakeAvailable()``` call, if you wish so, since it won't be overwritten and it'll show up when building the project.
6562
63+
> [!IMPORTANT]
64+
> If you want to use ```Windows```'s ```conio.h``` header file's functions in this library, you should set the ```INCLUDE_CONIO_FOR_IO``` option to ```ON```, since it's automatically off. You can try something like this on your project's main ```CMakeLists.txt```:
65+
>```
66+
> option(INCLUDE_CONIO_FOR_IO "Flag for including the conio.h header file" ON)
67+
> ```
68+
69+
6670
## How to use
6771
6872
You only need to include the ```cppsafeio.h``` header file. Henceforth, all of the library's functions will be available inside of the ```CppSafeIO``` namespace, similarly to the ```std``` namespace of the ```C++ Standard Library```. Here's a simple example showcasing a program that won't exit until the ```Enter``` key is pressed.
@@ -96,7 +100,17 @@ int main()
96100
* ```bool parseYesNoInput()```: Overloaded version of the previous function with both ```y``` and ```n``` as yesChar and noChar, respectively.
97101
* ```std::string getInputLine():``` gets all entered input until a line break, as a ```std::string```.
98102
99-
## Testing
103+
## Building & Testing
104+
105+
You can also just build and test the library independently from your projects, here's an example using ```bash``` in the library's directory:
106+
107+
```
108+
cmake -B build -DCMAKE_BUILD_TYPE=Release -S . && cmake --build build --config Release && cd build && ctest -V && cd ..
109+
```
110+
111+
As you can see, ```CMake``` is used to build the project and ```CTest``` to run the automated tests (the ```CppSafeIO-AutomatedTests``` executable)!
100112
101113
> [!TIP]
102-
> You can test this library's functions in the ```tests``` subdirectory.
114+
> If you wish to test out this library's functions, you can run the ```CppSafeIO-Tests``` executable. If it doesn't throw any exceptions or show any anomalies while getting input or cleaning output, then it should be working properly.
115+
116+
*Both of these tests' source code are available on the ```tests``` directory.*

0 commit comments

Comments
 (0)