Experimental general purpose utility library for C++ (at least C++17 required), which has become mostly a backbone for csv-oriented table editor, dfgQtTableEditor
Note: this is not a mature library and is not intended or recommended for general use. Libraries such as Abseil or Boost provide many of the features in dfglib implemented in a more clear and professional manner. For a comprehensive list of alternatives, see A list of open source C++ libraries at cppreference.com
- 2023-12-30: Code is no longer tested with GCC 7.5 and Clang 6.0.0, and for Qt-module, 5.12 is now considered minimum. Latest tested commit available in branch: legacy_GCC_7.5_Clang_6.0_Qt_5.9
- 2023-12-17, dfgQtTableEditor version 2.6.0 (Column filter from header context menu, CsvTableView regexFormat...)
- 2023-04-26, dfgQtTableEditor version 2.5.0 (Filter from selection, major performance improvements to charts...)
- 2022-10-30: In 481baa71 the minimum standard requirement in dfglib changed from C++11 to C++17 and code is no longer tested with MSVC2015, GCC 5.4 and Clang 3.8.0, latest tested commit available as branch: legacy_msvc_2015_GCC_5.4
- 2022-10-23, dfgQtTableEditor version 2.4.0 (Multithreaded reading, (x,y,text)-chart, read-only column, fixed crash opening big files...)
- 2022-05-22, dfgQtTableEditor version 2.3.0 (Numerically sortable columns, 'Change radix'-tool, textFilter chart operation...)
- 2022-01-18, dfgQtTableEditor version 2.2.0 (Hidable columns, date/time related improvements...)
- 2021-09-09, dfgQtTableEditor version 2.1.0 (multicolumn filtering, read-only mode...)
- 2021-06-24, dfgQtTableEditor version 2.0.0
- 2021-04-29, dfgQtTableEditor version 1.9.0
- 2021-02-21, dfgQtTableEditor version 1.8.0
- 2020-11-15, dfgQtTableEditor version 1.7.0
- 2020-08-16, dfgQtTableEditor version 1.6.0
- 2020-07-22: dfgQtTableEditor version 1.5.0
- 2020-02-11: dfglib is no longer tested with the following compilers:
- MSVC2010, MSVC2012, MSVC2013, MinGW 4.8.0
- Latest tested commit available as branch: legacy_msvc_2010_to_2013
- 2020-02-11: dfgQtTableEditor version 1.1.0
- 2019-09-10: dfgQtTableEditor version 1.0.0
Large proportion of features are 'header only' and can be used simply by including header without anything to link. When .cpp -files are needed, the intended usage is to include them in the build of the target project; there are no cmake-files etc. for building dfglib as a library.
- Make sure that Boost is available in include path
- With command line CMake
- cd dfgTest
- cmake CMakeLists.txt
- make
- ./dfgTest
- Visual studio project:
- Open dfgTest/dfgTest.sln
- Build and run dfgTest-project with an available MSVC-compiler.
For a list of supported compilers, see "Build status"-section in this document.
- Open dfgTestQt/dfgTestQt.pro in Qt Creator
- Choose suitable Qt kit and compiler to use
- Build and run
The library consists of miscellaneous features such as algorithms, containers, math/numerics, streams, typed string and UTF-handling. Below are some notable features:
-
Streams
- non-virtual streams with basic interface compatibility with standard streams.
- encoding-aware streams (i.e. streams that can read/write e.g. UTF-encoding (UTF8, UTF16BE/LE, UTF32BE/LE))
-
CSV-file reading/writing with somewhat reasonable performance (e.g. compared to some spreadsheet applications) and Qt-widgets for editing CSV-files.
-
Simple CSV-editor as an example, for details see it's readme
-
Typed strings (i.e. strings that store encoded text instead of raw bytes)
-
Algorithms such as
- median & percentile
- polynomial evaluation (Horner's method)
- spearman correlation
- spreadsheet sorting
Summary of 3rd party code in dfglib (last revised 2023-12-10).
Library | Usage | License | Comment |
---|---|---|---|
Boost | i,m,ti (used in numerous places) | Boost software license | Exact requirement for Boost version is unknown; unit tests have been successfully build and run with Boost versions 1.65.1, 1.70.0, 1.71.0 and 1.74.0 |
Colour Rendering of Spectra | m (used in colour handling tools) | Public domain | |
cppcsv (commit daa3d881, 2020-01-10) | c,t | MIT | |
dlib | m (unit-aware integration) | Boost software license | |
fast-csv-cpp-parser (commit 66365610, 2020-05-19) | c,t | BSD-3 | |
fmtlib (version 4.1.0 with an adjustment related to formatting doubles as string) | m (string formatting) | BSD-2 | |
GoogleTest (version 1.11.0) | t | BSD-3 | Unit test framework used in both dfgTest and dfgTestQt. |
LibQxt | c,t (QxtSpanSlider) | BSD-3 | Qt-related utilities |
muparser (version 2.3.3, commit 5ccc8878, 2022-01-13) with some edits | m (math::FormulaParser) | BSD-2 | Formula parser. Namespace of the code has been edited from mu to dfg_mu. |
QCustomPlot | oi (in parts of dfg/qt) | GPLv3/commercial | Used in data visualization (charts) in dfgQtTableEditor. Versions 2.0.1 and 2.1.1 are known to work as of dfgQtTableEditor version 2.6.0. |
Qt 5/6 | i (only for components in dfg/qt) | Various | Unit tests (dfgTestQt) have been build with various versions 5.9 - 6.4 in commit 9adba1ac (2023-12-17), but after that 5.12 is considered minimum. For details, see dfgTestQt status table. |
UTF8-CPP (version 3.2.5 with some adjustments) | m (utf handling) | Boost software license |
Usage types:
- c: All or some code from the library comes with dfglib (possibly modified), but is not directly used (i.e. related code can be removed without breaking any features in dfglib).
- i: Include dependency (i.e. some parts of dfglib may fail to compile if the 3rd party library is not available in include-path)
- m: Some code is integrated in dfglib itself possibly modified.
- oi: Like i, but optional component that is off by default.
- t: Used in test code without (external) include dependency (i.e. the needed code comes with dfglib).
- ti: Used in test code with include dependency.
Build status of general unit tests (dfgTest) (as of 2023-12-09 commit 55440f33)
Compiler | Standard library | C++ standard [1] | Platform | Boost | Tests (passed/all) | Comment |
---|---|---|---|---|---|---|
Clang 6.0.0 | libstdc++ 7 | C++17 | x86-64 | 1.65.1 | 100 % (327/327) | Ubuntu 64-bit 18.04 |
Clang 10.0.0 | libstdc++ 9 | C++17 | x86-64 | 1.71.0 | 100 % (327/327) | Ubuntu 64-bit 20.04 |
Clang 14.0.0 | libstdc++ 11 | C++17 | x86-64 | 1.74.0 | 100 % (327/327) | Ubuntu 64-bit 22.04 |
Clang 14.0.0 | libc++ 14000 | C++17 | x86-64 | 1.74.0 | 100 % (327/327) | Ubuntu 64-bit 22.04 |
clang-cl (Clang 16.0.5, MSVC2022.8) | MSVC | C++17 | x86-64 | 1.70.0 | 100 % (334/334) | See [2] |
GCC 7.5.0 | libstdc++ 7 | C++17 | x86-64 | 1.65.1 | 100 % (327/327) | Ubuntu 64-bit 18.04 |
GCC 9.4.0 | libstdc++ 9 | C++17 | x86-64 | 1.71.0 | 100 % (327/327) | Ubuntu 64-bit 20.04 |
GCC 11.4.0 | libstdc++ 11 | C++17 | x86-64 | 1.74.0 | 100 % (327/327) | Ubuntu 64-bit 22.04 |
MinGW 7.3.0 | libstdc++ 7 | C++17 | x86-64 | 1.70.0 | 100 % (334/334) | |
MinGW 11.2.0 | libstdc++ 11 | C++17 | x86-64 | 1.70.0 | 100 % (334/334) | |
VC2017.9 | MSVC | C++17 | x86-64 | 1.70.0 | 99 % (333/334) | Numerical precision related failure in dfgNumeric.transform |
VC2019.11 | MSVC | C++17 | x86-64 | 1.70.0 | 100 % (334/334) | std:c++17 with Conformance mode |
VC2022.8 | MSVC | C++20 | x86 | 1.70.0 | 100 % (334/334) | std:c++20 with Conformance mode |
VC2022.8 | MSVC | C++20 | x86-64 | 1.70.0 | 100 % (334/334) | std:c++20 with Conformance mode |
[1] As reported by __cplusplus macro or equivalent.
[2] If building with Clang < 13, need manual definition of wmemchr to build; for details, see notes in commit message c29dbe37. According to related MSVC bug ticket, the "issue belongs to clang and it was fixed in Clang 13"
Build status of Qt unit tests (dfgTestQt) (as of 2023-12-09 commit 55440f33)
Status | Compiler | Standard library | C++ standard [1] | Qt | Platform | Boost | Tests (passed/all) | Comment |
---|---|---|---|---|---|---|---|---|
✅ | Clang 6.0.0 | libstdc++ 7 | C++17 | 5.9.5 | x86-64 | 1.65.1 | 100 % (55/55) | Ubuntu 64-bit 18.04 |
✅ | Clang 10.0.0 | libc++ 10000 | C++17 | 5.12.8 | x86-64 | 1.71.0 | 100 % (57/57) | Ubuntu 64-bit 20.04 |
✅ | Clang 10.0.0 | libstdc++ 9 | C++17 | 5.12.8 | x86-64 | 1.71.0 | 100 % (57/57) | Ubuntu 64-bit 20.04 |
✅ | Clang 14.0.0 | libstdc++ 11 | C++17 | 6.2.4 | x86-64 | 1.74.0 | 100 % (57/57) | Ubuntu 64-bit 22.04 |
🔴 | Clang 14.0.0 | libc++ 14000 | C++17 | 6.2.4 | x86-64 | 1.74.0 | N/A | Ubuntu 64-bit 22.04. Causes linker errors from QMetaType. For details, see error messages in a separate file |
✅ | clang-cl (Clang 16.0.5, MSVC2022.5) | MSVC | C++17 | 6.4.1 | x86-64 | 1.70.0 | 100 % (57/57) | |
✅ | GCC 7.5.0 | libstdc++ 7 | C++17 | 5.9.5 | x86-64 | 1.65.1 | 100 % (55/55) | Ubuntu 64-bit 18.04 |
✅ | GCC 9.4.0 | libstdc++ 9 | C++17 | 5.12.8 | x86-64 | 1.71.0 | 100 % (57/57) | Ubuntu 64-bit 20.04 |
✅ | GCC 11.4.0 | libstdc++ 11 | C++17 | 6.2.4 | x86-64 | 1.74.0 | 100 % (57/57) | Ubuntu 64-bit 22.04 |
✅ | MinGW 11.2.0 | libstdc++ 11 | C++17 | 6.4.1 | x86-64 | 1.70.0 | 100 % (57/57) | |
✅ | VC2019.11 | MSVC | C++17 | 5.15.2 | x86-64 | 1.70.0 | 100 % (57/57) | |
✅ | VC2019.11 | MSVC | C++17 | 6.4.1 | x86-64 | 1.70.0 | 100 % (57/57) | |
✅ | VC2022.8 | MSVC | C++17 | 6.4.1 | x86-64 | 1.70.0 | 100 % (57/57) | |
✅ | VC2022.8 | MSVC | C++20 | 6.4.1 | x86-64 | 1.70.0 | 100 % (57/57) |
[1] As reported by __cplusplus macro or equivalent.
Note: dfgQt.CsvTableView_paste has been experienced to fail on Windows if VirtualBox is running a virtual machine; Qt logs "Unable to obtain clipboard" during the test case.
Compiler/library | Untested since | Support branch |
---|---|---|
GCC 7.5 | 2023-12-30 | legacy_GCC_7.5_Clang_6.0_Qt_5.9 |
Clang 6.0.0 | 2023-12-30 | legacy_GCC_7.5_Clang_6.0_Qt_5.9 |
Qt 5.9 | 2023-12-30 | legacy_GCC_7.5_Clang_6.0_Qt_5.9 |
MSVC2015 | 2022-10-30 | legacy_msvc_2015_GCC_5.4 |
GCC 5.4 | 2022-10-30 | legacy_msvc_2015_GCC_5.4 |
Clang 3.8.0 | 2022-10-30 | legacy_msvc_2015_GCC_5.4 |
MSVC2013 | 2020-02-11 | legacy_msvc_2010_to_2013 |
MSVC2012 | 2020-02-11 | legacy_msvc_2010_to_2013 |
MSVC2010 | 2020-02-11 | legacy_msvc_2010_to_2013 |
MinGW 4.8.0 | 2020-02-11 | legacy_msvc_2010_to_2013 |