Skip to content

Commit

Permalink
Merge pull request #48 from jimbraun/0047-header-before-open
Browse files Browse the repository at this point in the history
0047-header-before-open
  • Loading branch information
jimbraun committed Jul 20, 2015
2 parents 2ca0f78 + d130769 commit af8200e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions include/xcdf/XCDFFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,8 @@ class XCDFFile {
}

XCDFDataManager<double> manager =
AllocateField(name, XCDF_FLOATING_POINT, resolution, parentName);
AllocateField(name, XCDF_FLOATING_POINT,
resolution, parentName, true);
floatingPointFieldList_.push_back(manager);
floatingPointBareFieldList_.push_back(manager.GetField());
floatingPointFieldMap_.insert(std::pair<std::string,
Expand Down Expand Up @@ -545,7 +546,8 @@ class XCDFFile {
CheckModifiable();

XCDFDataManager<uint64_t> manager =
AllocateField(name, XCDF_UNSIGNED_INTEGER, resolution, parentName);
AllocateField(name, XCDF_UNSIGNED_INTEGER,
resolution, parentName, true);
unsignedIntegerFieldList_.push_back(manager);
unsignedIntegerBareFieldList_.push_back(manager.GetField());
unsignedIntegerFieldMap_.insert(std::pair<std::string,
Expand Down Expand Up @@ -587,7 +589,8 @@ class XCDFFile {
CheckModifiable();

XCDFDataManager<int64_t> manager =
AllocateField(name, XCDF_SIGNED_INTEGER, resolution, parentName);
AllocateField(name, XCDF_SIGNED_INTEGER,
resolution, parentName, true);
signedIntegerFieldList_.push_back(manager);
signedIntegerBareFieldList_.push_back(manager.GetField());
signedIntegerFieldMap_.insert(std::pair<std::string,
Expand Down Expand Up @@ -771,7 +774,8 @@ class XCDFFile {
XCDFDataManager<T> AllocateField(const std::string& name,
const XCDFFieldType type,
const T resolution,
const std::string& parentName = "") {
const std::string& parentName = "",
bool writeHeader = false) {

// Check if we already have a field with the given name
if (HasField(name)) {
Expand Down Expand Up @@ -809,7 +813,7 @@ class XCDFFile {
}

// If writing, put the descriptor into the header
if (IsWritable()) {
if (writeHeader) {
XCDFFieldDescriptor descriptor;
descriptor.name_ = name;
descriptor.type_ = type;
Expand Down

0 comments on commit af8200e

Please sign in to comment.