Updates & Simplifications
Created by: VictorSCushman
Hello Martín.
I was browsing the source of LDPL and noticed that it was using the cpptrim.h
file from this repository.
I thought that there were some simplifications that could be done to the cpptrim library to make the source code smaller and cleaner.
The changes in this merge request basically completely overhaul the library. Some of the things changed:
- cpptrim uses the built-in
std::string
methods instead of manually searching character by character. - cpptrim was given its own
cpptrim
namespace to avoid potential name conflicts in other projects. -
cpptrim::trim_left
andcpptrim::trim_right
were added that trim leading and trailing whitespace respectively. - More tests/examples were added to
example/example.cpp
. The example file was tested usingclang++ --std=c++11 -Wall -Wextra example/example.cpp
Since this basically changes the entire library I can understand if you'd rather not accept this pull request, but I thought both as a way to give back to the open source community and further the development of LDPL I would submit my changes.