Improve docs. Make getFieldT(offset) use vector::at.
This commit is contained in:
committed by
mdavidsaver
parent
a29894ee2b
commit
4dd7a18301
@@ -566,20 +566,6 @@ FieldConstPtr Structure::getFieldImpl(string const & fieldName, bool throws) con
|
||||
}
|
||||
}
|
||||
|
||||
FieldConstPtr Structure::getFieldImpl(size_t fieldOffset, bool throws) const {
|
||||
if (fieldOffset < fields.size())
|
||||
return fields[fieldOffset];
|
||||
|
||||
if (throws) {
|
||||
std::stringstream ss;
|
||||
ss << "Failed to get field with offset "
|
||||
<< fieldOffset << " (Invalid offset)";
|
||||
throw std::runtime_error(ss.str());
|
||||
} else {
|
||||
return FieldConstPtr();
|
||||
}
|
||||
}
|
||||
|
||||
std::ostream& Structure::dump(std::ostream& o) const
|
||||
{
|
||||
o << format::indent() << getID() << std::endl;
|
||||
@@ -794,20 +780,6 @@ FieldConstPtr Union::getFieldImpl(string const & fieldName, bool throws) const {
|
||||
}
|
||||
}
|
||||
|
||||
FieldConstPtr Union::getFieldImpl(size_t fieldOffset, bool throws) const {
|
||||
if (fieldOffset < fields.size())
|
||||
return fields[fieldOffset];
|
||||
|
||||
if (throws) {
|
||||
std::stringstream ss;
|
||||
ss << "Failed to get field with offset "
|
||||
<< fieldOffset << " (Invalid offset)";
|
||||
throw std::runtime_error(ss.str());
|
||||
} else {
|
||||
return FieldConstPtr();
|
||||
}
|
||||
}
|
||||
|
||||
std::ostream& Union::dump(std::ostream& o) const
|
||||
{
|
||||
o << format::indent() << getID() << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user