Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
ColumnDescription.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2012-2022 Euclid Science Ground Segment
3 *
4 * This library is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License as published by the Free
6 * Software Foundation; either version 3.0 of the License, or (at your option)
7 * any later version.
8 *
9 * This library is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 * details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
28
29namespace Euclid {
30namespace Table {
31
33 std::string input_description)
34 : ColumnDescription(input_name, input_type, 0, input_unit, input_description) {}
35
37 std::string input_unit, std::string input_description)
38 : name(input_name), type(input_type), unit(input_unit), description(input_description), size(input_size) {
39 static const regex::regex vertical_whitespace{".*[\\n\\v\\f\\r].*"};
40
41 if (input_name.empty()) {
42 throw Elements::Exception() << "Empty string name is not allowed";
43 }
44 if (regex_match(input_name, vertical_whitespace)) {
45 throw Elements::Exception() << "Column name '" << input_name << "' contains "
46 << "vertical whitespace characters";
47 }
48}
49
50} // namespace Table
51} // namespace Euclid
Contains the description of a specific column of a Table.
ColumnDescription(std::string name, std::type_index type=typeid(std::string), std::string unit="", std::string description="")
T empty(T... args)