Files
IfcOpenShell/src/ifcparse/Argument.h
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

75 lines
3.1 KiB
C++
Raw Normal View History

2017-06-05 17:26:58 +02:00
/********************************************************************************
* *
* This file is part of IfcOpenShell. *
* *
* IfcOpenShell is free software: you can redistribute it and/or modify *
* it under the terms of the Lesser GNU General Public License as published by *
* the Free Software Foundation, either version 3.0 of the License, or *
* (at your option) any later version. *
* *
* IfcOpenShell is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
#ifndef ARGUMENT_H
#define ARGUMENT_H
2023-03-31 15:19:39 -04:00
#include "ArgumentType.h"
2023-09-17 12:30:17 +02:00
#include "ifc_parse_api.h"
2017-06-05 17:26:58 +02:00
#include <boost/dynamic_bitset.hpp>
2021-07-27 15:46:38 +02:00
#include <boost/logic/tribool.hpp>
2023-09-17 12:30:17 +02:00
#include <boost/shared_ptr.hpp>
#include <string>
#include <vector>
2017-06-05 17:26:58 +02:00
2021-07-29 14:54:51 +02:00
class aggregate_of_instance;
class aggregate_of_aggregate_of_instance;
2017-06-05 17:26:58 +02:00
namespace IfcUtil {
2023-09-17 12:30:17 +02:00
class IfcBaseClass;
2017-06-05 17:26:58 +02:00
2023-09-17 12:30:17 +02:00
IFC_PARSE_API const char* ArgumentTypeToString(ArgumentType argument_type);
2017-06-05 17:26:58 +02:00
2023-09-17 12:30:17 +02:00
/// Returns false when the string `s` contains character outside of {'0', '1'}
IFC_PARSE_API bool valid_binary_string(const std::string& string);
2023-09-17 12:30:17 +02:00
} // namespace IfcUtil
2017-06-05 17:26:58 +02:00
class IFC_PARSE_API Argument {
2023-09-17 12:30:17 +02:00
public:
virtual operator int() const;
virtual operator bool() const;
virtual operator boost::logic::tribool() const;
virtual operator double() const;
virtual operator std::string() const;
virtual operator boost::dynamic_bitset<>() const;
virtual operator IfcUtil::IfcBaseClass*() const;
virtual operator std::vector<int>() const;
virtual operator std::vector<double>() const;
virtual operator std::vector<std::string>() const;
virtual operator std::vector<boost::dynamic_bitset<>>() const;
virtual operator boost::shared_ptr<aggregate_of_instance>() const;
2017-06-05 17:26:58 +02:00
2023-09-17 12:30:17 +02:00
virtual operator std::vector<std::vector<int>>() const;
virtual operator std::vector<std::vector<double>>() const;
virtual operator boost::shared_ptr<aggregate_of_aggregate_of_instance>() const;
2017-06-05 17:26:58 +02:00
2023-09-17 12:30:17 +02:00
virtual bool isNull() const = 0;
virtual unsigned int size() const = 0;
2017-06-05 17:26:58 +02:00
2023-09-17 12:30:17 +02:00
virtual IfcUtil::ArgumentType type() const = 0;
virtual Argument* operator[](unsigned int index) const = 0;
2023-09-17 12:30:17 +02:00
virtual std::string toString(bool upper = false) const = 0;
2017-06-05 17:26:58 +02:00
2023-09-17 12:30:17 +02:00
virtual ~Argument(){};
2017-06-05 17:26:58 +02:00
};
#endif