Skip to content

Commit

Permalink
existing SWIG bindings also want to get/set the FileHeader version as…
Browse files Browse the repository at this point in the history
… a string
  • Loading branch information
Dan Smith committed Sep 8, 2023
1 parent 478b871 commit a461ff7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion six/modules/c++/cphd/include/cphd/FileHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ class FileHeader final : public BaseFileHeader
*
* returns file version string
*/
Version getVersion() const;
std::string getVersion() const;
void getVersion(Version&) const;

/*
* \func setVersion
Expand All @@ -111,6 +112,7 @@ class FileHeader final : public BaseFileHeader
* ex: 1.0.0, 1.0.1 etc
*
*/
void setVersion(const std::string&);
void setVersion(Version);

/*
Expand Down
12 changes: 10 additions & 2 deletions six/modules/c++/cphd/source/FileHeader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,23 @@ std::string FileHeader::toString() const
return os.str();
}

Version FileHeader::getVersion() const
std::string FileHeader::getVersion() const
{
return mVersion;
return to_string(mVersion);
}
void FileHeader::getVersion(Version& version) const
{
version = mVersion;
}

void FileHeader::setVersion(Version version)
{
mVersion = version;
}
void FileHeader::setVersion(const std::string& strVersion)
{
setVersion(FileHeader::toVersion(strVersion));
}

size_t FileHeader::set(int64_t xmlBlockSize,
int64_t supportBlockSize,
Expand Down

0 comments on commit a461ff7

Please sign in to comment.