BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
dataloader_types.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/dataloader/dataloader_types.h
6 //! @brief Defines class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI2_DATALOADER_DATALOADER_TYPES_H
16 #define BORNAGAIN_GUI2_DATALOADER_DATALOADER_TYPES_H
17 
18 #include "darefl_export.h"
19 #include <functional>
20 #include <string>
21 #include <vector>
22 
23 namespace gui2 {
24 
25 //! Parser options to process multi column ASCII files.
26 
27 struct DAREFLCORE_EXPORT ParserOptions { // #import Here the options for the default parser are defined
28  std::string m_header_prefix = "#"; //!< prefix denoting header line
29  std::string m_separator = " "; //!< column separator
30  std::string m_skip_index_pattern; //!< pattern denoting line to skip (i.e. '1,10-12,42')
31 };
32 
33 //! Info about the column as defined by the user via ImportTableWidget.
34 
35 struct DAREFLCORE_EXPORT ColumnInfo {
36  int column{-1};
37  std::string type_name;
38  std::string units;
39  double multiplier{0.0};
40 };
41 
42 //! Function to define if given index satisfies criteria.
43 using accept_int_t = std::function<bool(int)>;
44 
45 //! Function to define if given string should be accepted for further consideration.
46 using accept_string_t = std::function<bool(const std::string& line)>;
47 
48 //! Function to define line splitter according to some criteria.
49 using line_splitter_t = std::function<std::vector<std::string>(const std::string& line)>;
50 
51 } // namespace gui2
52 
53 #endif // BORNAGAIN_GUI2_DATALOADER_DATALOADER_TYPES_H
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20
std::function< bool(const std::string &line)> accept_string_t
Function to define if given string should be accepted for further consideration.
std::function< bool(int)> accept_int_t
Function to define if given index satisfies criteria.
std::function< std::vector< std::string >(const std::string &line)> line_splitter_t
Function to define line splitter according to some criteria.
Info about the column as defined by the user via ImportTableWidget.
std::string type_name
Parser options to process multi column ASCII files.
std::string m_skip_index_pattern
pattern denoting line to skip (i.e. '1,10-12,42')