Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update doc for Mach-O Source Version
  • Loading branch information
romainthomas committed Jul 8, 2017
1 parent ce66916 commit 0b4bb7d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions api/python/MachO/objects/pySourceVersion.cpp
Expand Up @@ -35,9 +35,9 @@ void init_MachO_SourceVersion_class(py::module& m) {
py::class_<SourceVersion, LoadCommand>(m, "SourceVersion")

.def_property("version",
static_cast<getter_t<const version_t&>>(&SourceVersion::version),
static_cast<setter_t<const version_t&>>(&SourceVersion::version),
"TODO",
static_cast<getter_t<const SourceVersion::version_t&>>(&SourceVersion::version),
static_cast<setter_t<const SourceVersion::version_t&>>(&SourceVersion::version),
"Version as a tuple of **5** integers",
py::return_value_policy::reference_internal)


Expand Down
12 changes: 8 additions & 4 deletions include/LIEF/MachO/SourceVersion.hpp
Expand Up @@ -27,10 +27,13 @@

namespace LIEF {
namespace MachO {
using version_t = std::array<uint32_t, 5>;

class DLL_PUBLIC SourceVersion : public LoadCommand {

public:
//! @brief Version is an array of **5** integers
using version_t = std::array<uint32_t, 5>;

SourceVersion(void);
SourceVersion(const source_version_command *version_cmd);

Expand All @@ -39,8 +42,9 @@ class DLL_PUBLIC SourceVersion : public LoadCommand {

virtual ~SourceVersion(void);

const version_t& version(void) const;
void version(const version_t& version);
//! @brief Return the version as an array
const SourceVersion::version_t& version(void) const;
void version(const SourceVersion::version_t& version);

bool operator==(const SourceVersion& rhs) const;
bool operator!=(const SourceVersion& rhs) const;
Expand All @@ -50,7 +54,7 @@ class DLL_PUBLIC SourceVersion : public LoadCommand {
virtual std::ostream& print(std::ostream& os) const override;

private:
version_t version_;
SourceVersion::version_t version_;
};

}
Expand Down
6 changes: 3 additions & 3 deletions src/MachO/SourceVersion.cpp
Expand Up @@ -42,11 +42,11 @@ SourceVersion::SourceVersion(const source_version_command *version_cmd) :
}


const version_t& SourceVersion::version(void) const {
const SourceVersion::version_t& SourceVersion::version(void) const {
return this->version_;
}

void SourceVersion::version(const version_t& version) {
void SourceVersion::version(const SourceVersion::version_t& version) {
this->version_ = version;
}

Expand All @@ -69,7 +69,7 @@ bool SourceVersion::operator!=(const SourceVersion& rhs) const {

std::ostream& SourceVersion::print(std::ostream& os) const {
LoadCommand::print(os);
const version_t& version = this->version();
const SourceVersion::version_t& version = this->version();
os << "Version: " << std::dec
<< version[0] << "."
<< version[1] << "."
Expand Down

0 comments on commit 0b4bb7d

Please sign in to comment.