mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 20:50:02 +00:00
Fix additional warnings identified in #139
This commit is contained in:
@@ -26,11 +26,12 @@ static const char * const HEADER = "HEADER";
|
|||||||
static const char * const FILE_DESCRIPTION = "FILE_DESCRIPTION";
|
static const char * const FILE_DESCRIPTION = "FILE_DESCRIPTION";
|
||||||
static const char * const FILE_NAME = "FILE_NAME";
|
static const char * const FILE_NAME = "FILE_NAME";
|
||||||
static const char * const FILE_SCHEMA = "FILE_SCHEMA";
|
static const char * const FILE_SCHEMA = "FILE_SCHEMA";
|
||||||
static const char * const FILE_POPULATION = "FILE_POPULATION";
|
|
||||||
static const char * const SECTION_LANGUAGE = "SECTION_LANGUAGE";
|
|
||||||
static const char * const SECTION_CONTEXT = "SECTION_CONTEXT";
|
|
||||||
static const char * const ENDSEC = "ENDSEC";
|
static const char * const ENDSEC = "ENDSEC";
|
||||||
static const char * const DATA = "DATA";
|
static const char * const DATA = "DATA";
|
||||||
|
// The following header entities are not normally encountered in IFC files and are not parsed.
|
||||||
|
// static const char * const FILE_POPULATION = "FILE_POPULATION";
|
||||||
|
// static const char * const SECTION_LANGUAGE = "SECTION_LANGUAGE";
|
||||||
|
// static const char * const SECTION_CONTEXT = "SECTION_CONTEXT";
|
||||||
|
|
||||||
using namespace IfcParse;
|
using namespace IfcParse;
|
||||||
|
|
||||||
@@ -61,6 +62,16 @@ void IfcSpfHeader::read() {
|
|||||||
readTerminal(ISO_10303_21, TRAILING_SEMICOLON);
|
readTerminal(ISO_10303_21, TRAILING_SEMICOLON);
|
||||||
readTerminal(HEADER, TRAILING_SEMICOLON);
|
readTerminal(HEADER, TRAILING_SEMICOLON);
|
||||||
|
|
||||||
|
// | The header section of every exchange structure shall contain one
|
||||||
|
// | instance of each of the following entities: file_description, file_name,
|
||||||
|
// | and file_schema, and they shall appear in that order. Instances of
|
||||||
|
// | file_population, section_language and section_context may appear after
|
||||||
|
// | file_schema. If instances of user-defined header section entities are
|
||||||
|
// | present, they shall appear after the header section entity instances
|
||||||
|
// | defined in this section.
|
||||||
|
//
|
||||||
|
// ISO 10303-21 Second edition 2002-01-15 p. 16
|
||||||
|
|
||||||
readTerminal(FILE_DESCRIPTION, TRAILING_PAREN);
|
readTerminal(FILE_DESCRIPTION, TRAILING_PAREN);
|
||||||
delete _file_description;
|
delete _file_description;
|
||||||
_file_description = new FileDescription(_lexer);
|
_file_description = new FileDescription(_lexer);
|
||||||
@@ -96,7 +107,6 @@ void IfcSpfHeader::write(std::ostream& os) const {
|
|||||||
os << DATA << ";" << "\n";
|
os << DATA << ";" << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const FileDescription& IfcSpfHeader::file_description() const {
|
const FileDescription& IfcSpfHeader::file_description() const {
|
||||||
if (_file_description) {
|
if (_file_description) {
|
||||||
return *_file_description;
|
return *_file_description;
|
||||||
|
|||||||
@@ -50,13 +50,13 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setArgument(unsigned int i, const std::string& s) {
|
void setArgument(unsigned int i, const std::string& s) {
|
||||||
IfcWrite::IfcWriteArgument* argument = new IfcWrite::IfcWriteArgument(this);
|
IfcWrite::IfcWriteArgument* argument = new IfcWrite::IfcWriteArgument;
|
||||||
argument->set(s);
|
argument->set(s);
|
||||||
_list->set(i, argument);
|
_list->set(i, argument);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setArgument(unsigned int i, const std::vector<std::string>& s) {
|
void setArgument(unsigned int i, const std::vector<std::string>& s) {
|
||||||
IfcWrite::IfcWriteArgument* argument = new IfcWrite::IfcWriteArgument(this);
|
IfcWrite::IfcWriteArgument* argument = new IfcWrite::IfcWriteArgument;
|
||||||
argument->set(s);
|
argument->set(s);
|
||||||
_list->set(i, argument);
|
_list->set(i, argument);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ void IfcWritableEntity::arg_writable(int i, bool b) {
|
|||||||
|
|
||||||
template <typename T> void IfcWritableEntity::_setArgument(int i, const T& t) {
|
template <typename T> void IfcWritableEntity::_setArgument(int i, const T& t) {
|
||||||
if ( arg_writable(i) ) delete args[i];
|
if ( arg_writable(i) ) delete args[i];
|
||||||
IfcWriteArgument* arg = new IfcWriteArgument(this);
|
IfcWriteArgument* arg = new IfcWriteArgument;
|
||||||
args[i] = arg;
|
args[i] = arg;
|
||||||
arg->set(t);
|
arg->set(t);
|
||||||
arg_writable(i,true);
|
arg_writable(i,true);
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ namespace IfcWrite {
|
|||||||
};
|
};
|
||||||
class Derived {};
|
class Derived {};
|
||||||
private:
|
private:
|
||||||
IfcAbstractEntity* entity;
|
|
||||||
boost::variant<
|
boost::variant<
|
||||||
// A null argument, it will always serialize to $
|
// A null argument, it will always serialize to $
|
||||||
boost::none_t,
|
boost::none_t,
|
||||||
@@ -108,7 +107,6 @@ namespace IfcWrite {
|
|||||||
IfcEntityListList::ptr
|
IfcEntityListList::ptr
|
||||||
> container;
|
> container;
|
||||||
public:
|
public:
|
||||||
IfcWriteArgument(IfcAbstractEntity* e) : entity(e) {}
|
|
||||||
template <typename T> const T& as() const {
|
template <typename T> const T& as() const {
|
||||||
if (const T* val = boost::get<T>(&container)) {
|
if (const T* val = boost::get<T>(&container)) {
|
||||||
return *val;
|
return *val;
|
||||||
|
|||||||
Reference in New Issue
Block a user