{"id":23924547,"url":"https://github.com/scandyna/mdtplaintext","last_synced_at":"2025-02-23T23:23:07.165Z","repository":{"id":146525943,"uuid":"270293218","full_name":"scandyna/MdtPlainText","owner":"scandyna","description":"Provides some libraries to read and write simple plain text using the boost Spirit library. The main use case is a CSV parser that should read files conforming to CSV-1203 and RFC-4180 standards.","archived":false,"fork":false,"pushed_at":"2024-11-11T10:51:38.000Z","size":649,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"experimental","last_synced_at":"2025-01-05T19:15:28.247Z","etag":null,"topics":["csv","csv-parser","qstring","qt"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scandyna.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-07T12:03:58.000Z","updated_at":"2024-11-11T10:51:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"0dccaf63-db41-450c-ad18-ba9867d0d217","html_url":"https://github.com/scandyna/MdtPlainText","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scandyna%2FMdtPlainText","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scandyna%2FMdtPlainText/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scandyna%2FMdtPlainText/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scandyna%2FMdtPlainText/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scandyna","download_url":"https://codeload.github.com/scandyna/MdtPlainText/tar.gz/refs/heads/experimental","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240392214,"owners_count":19794035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv","csv-parser","qstring","qt"],"created_at":"2025-01-05T19:15:29.843Z","updated_at":"2025-02-23T23:23:06.804Z","avatar_url":"https://github.com/scandyna.png","language":"C++","readme":"\n| Topic                    | Status                                                                                                                                 |\n|:-------------------------|:---------------------------------------------------------------------------------------------------------------------------------------|\n| `Build / test (CI)`  | [![pipeline status](https://gitlab.com/scandyna/mdtplaintext/badges/experimental/pipeline.svg)](https://gitlab.com/scandyna/mdtplaintext/-/commits/experimental)   |\n| `Coverity`               | [![Coverity](https://scan.coverity.com/projects/21719/badge.svg)](https://scan.coverity.com/projects/scandyna-mdtplaintext) |\n| `OpenHub`                | [View on OpenHub](https://www.openhub.net/p/MdtPlainText) |\n\n# MdtPlainText\n\nProvides some libraries to read and write simple plain text\nusing the [boost Spirit](https://www.boost.org/doc/libs/1_73_0/libs/spirit/doc/html/index.html) library.\n\nThe main use case is a CSV parser, that should read files conform to\n[CSV-1203](https://idoc.pub/documents/csv-file-format-specification-standard-csv-1203-6nq88y5xr9nw)\nand\n[RFC 4180](https://tools.ietf.org/html/rfc4180)\n\n\n# Usage\n\nFor the available classes, functions, and their usage,\nsee [the API documentation](https://scandyna.gitlab.io/mdtplaintext)\n\n## Required tools and libraries\n\nSome tools and libraries are required to use MdtPlainText:\n - Git\n - CMake\n - Conan (optional)\n - A compiler (Gcc or Clang or MSVC)\n - Make (optional)\n - Qt5 (optional: for libraries with Qt support or for the tests)\n\nFor a overview how to install them, see https://gitlab.com/scandyna/build-and-install-cpp\n\n## CMake project description\n\nUpdate your CMakeLists.txt to use the required libraries:\n```cmake\ncmake_minimum_required(VERSION 3.15)\nproject(MyApp)\n\nfind_package(Mdt0 REQUIRED COMPONENTS PlainText)\n\nadd_executable(myApp myApp.cpp)\ntarget_link_libraries(myApp Mdt0::PlainText)\n```\n\nIf you use Qt, you can use `PlainText_QtCore`:\n```cmake\ncmake_minimum_required(VERSION 3.15)\nproject(MyApp)\n\nfind_package(Qt5 REQUIRED COMPONENTS Widgets)\nfind_package(Mdt0 REQUIRED COMPONENTS PlainText_QtCore)\n\nadd_executable(myApp myApp.cpp)\ntarget_link_libraries(myApp Mdt0::PlainText_QtCore)\n```\n\n## Project using Conan\n\nIf you use [Conan](https://conan.io/),\nadd MdtPlainText as requirement in your `conanfile.txt`:\n```conan\n[requires]\nmdtplaintext/x.y.z@scandyna/testing\n\n[generators]\nCMakeDeps\nCMakeToolchain\nVirtualBuildEnv\n```\n\nIf you need better unicode support,\nyou may choose the Qt based one:\n```conan\n[requires]\nmdtplaintext_qtcore/x.y.z@scandyna/testing\n\n[generators]\nCMakeDeps\nCMakeToolchain\nVirtualBuildEnv\n```\n\n# Build and install MdtPlainText\n\nThis chapter covers only the installation of the library.\nTo run the unit tests, see the next chapter.\n\nGet MdtPlainText:\n```bash\ngit clone git@gitlab.com:scandyna/mdtplaintext.git\n```\n\nCreate a build directory and cd to it:\n```bash\nmkdir build\ncd build\n```\n\n## Note about install prefix\n\nSome note on the `CMAKE_INSTALL_PREFIX`:\n - To target a system wide installation on Linux, set it to `/usr` (`-DCMAKE_INSTALL_PREFIX=/usr`) .\n - For other locations, spcecify also the `\u003cpackage-name\u003e`, (for example `-DCMAKE_INSTALL_PREFIX=~/opt/MdtPlainText`).\n\nFor details about that, see:\n - https://scandyna.gitlab.io/mdt-cmake-modules/Modules/MdtInstallDirs.html\n - https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html\n - https://scandyna.gitlab.io/mdt-cmake-modules/Modules/MdtInstallLibrary.html\n\n## Build and install MdtPlainText using Conan\n\nThis is the recommended way.\n\n## Project configuration using Conan\n\nMdtPlainText has those dependencies:\n - [mdt-cmake-modules](https://gitlab.com/scandyna/mdt-cmake-modules)\n - boost\n - Qt\n\nHere are the available options:\n\n| Option           | Default | Possible Values  | Explanations |\n| -----------------|:------- |:----------------:|--------------|\n| shared           | True    |  [True, False]   | Build as shared library |\n\n### Using Conan profiles\n\nWhen using Conan for dependency management,\nit is recommended to use Conan profiles.\nThis permits to have personal binary repository,\navoiding to recompile everything everytime.\nThis becomes more important if Qt is managed by Conan.\n\nThis requires modifications in the `settings.yml` Conan configuration,\nand also some profile files.\nSee my [conan-config repository](https://gitlab.com/scandyna/conan-config) for more informations.\n\nSome following sections will rely on Conan profiles.\n\n### Build and install on Linux with the native compiler\n\nInstall the dependencies:\n```bash\nconan install -s build_type=Release --build=missing ..\n```\n\nConfigure MdtPlainText:\n```bash\ncmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/opt/MdtPlainText ..\ncmake-gui .\n```\n\nTo build and install, run:\n```bash\ncmake --build . --target INSTALL\n```\n\n### Build and install on Windows MinGW\n\nOpen a terminal that has gcc and mingw32-make in the PATH.\n\nCreate a build directory and go to it:\n```bash\nmkdir build\ncd build\n```\n\nInstall the required dependencies:\n```bash\nconan install --profile windows_gcc7_x86_64 -s build_type=Release --build=missing ..\n```\n\nConfigure the project:\n```bash\ncmake -G\"MinGW Makefiles\" -DCMAKE_INSTALL_PREFIX=C:\\some\\path -DCMAKE_BUILD_TYPE=Release ..\ncmake-gui .\n```\n\nIf `QT_PREFIX_PATH` was not specified, and no Qt5 installation is in the `PATH`,\na error will probably occur, telling that Qt was not found.\nSet the `QT_PREFIX_PATH` by choosing the path to the Qt5 installation,\nthen run \"Configure\".\n\nAlso choose different options, like the components to build.\nOnce done, run \"Generate\", then quit cmake-gui.\n\nTo build and install, run:\n```bash\ncmake --build . --target INSTALL\n```\n\n# Work on MdtPlainText\n\nThis chapter is like the previous (Install MdtPlainText),\nbut covers some more details, like the dependencies and options to run the unit tests.\n\n## Required tools and libraries\n\nThe dependencies are the same as in previous chapter plus those:\n - [Catch2](https://github.com/catchorg/Catch2)\n\nIf you use Conan, nothing has to be installed explicitely.\nOtherwise, see the documentation of the dependencies.\n\n\n## Build on Linux with the native compiler\n\nInstall the dependencies:\n```bash\nconan install -s build_type=Debug -o build_tests=True --build=missing ..\n```\n\nConfigure MdtPlainText:\n```bash\ncmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON ..\ncmake-gui .\n```\n\nTo build , run:\n```cmd\ncmake --build .\n```\n\n## Build on Linux with Clang and libc++\n\nInstall the dependencies if Qt is used:\n```bash\nconan install --profile linux_clang6.0_x86_64_libc++_qt_gui_modules -s build_type=Debug -o use_conan_qt=True -o build_tests=True --build=missing ..\n```\n\nActivate the build environment:\n```bash\nsource activate.sh\n```\n\nConfigure MdtPlainText:\n```bash\ncmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON ..\ncmake-gui .\n```\n\nBuild and run the tests:\n```bash\ncmake --build .\nctest . --output-on-failure\n```\n\nTo restore the standard environment:\n```bash\nsource deactivate.sh\n```\n\n## Configure and build with ThreadSanitizer\n\nGcc supports ThreadSanitizer, but Clang seems to give less false positive.\nThis is what I experieced on Ubuntu 18.04 with those default compilers.\n\nInstall the required dependencies:\n```bash\nconan install --profile linux_clang6.0_x86_64_libc++_tsan_qt_gui_modules -o use_conan_qt=True -o build_tests=True  ..\n```\n\nActivate the build environment:\n```bash\nsource activate.sh\n```\n\nConfigure MdtPlainText:\n```bash\ncmake -DCMAKE_BUILD_TYPE=Instrumented -DSANITIZER_ENABLE_THREAD=ON ..\ncmake-gui .\n```\n\nBuild and run the tests:\n```bash\ncmake --build . --config Instrumented\nctest . --output-on-failure -C Instrumented\n```\n\nTo restore the standard environment:\n```bash\nsource deactivate.sh\n```\n\n# Create a Conan package\n\nThe package version is picked up from git tag.\nIf working on MdtPlainText, go to the root of the source tree:\n```bash\ngit tag x.y.z\nconan create . scandyna/testing --profile $CONAN_PROFILE -s build_type=$BUILD_TYPE\n```\n\nAbove examples will generate a package that uses the Qt and boost version that are installed on the system,\nor passed to the `CMAKE_PREFIX_PATH` of your build.\n\nTo create packages that depend on Conan Qt and boost:\n```bash\nconan create . scandyna/testing -o MdtPlainText:use_conan_qt=True -o MdtPlainText:use_conan_boost=True\n```\n\nBecause Qt offers binary compatibility,\nit should not be required to create package for each minor Qt version,\nbut more a package per compiler and other things that breaks binary compatibility.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscandyna%2Fmdtplaintext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscandyna%2Fmdtplaintext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscandyna%2Fmdtplaintext/lists"}