diff options
author | Orochimarufan <orochimarufan.x3@gmail.com> | 2013-02-24 17:06:00 +0100 |
---|---|---|
committer | Orochimarufan <orochimarufan.x3@gmail.com> | 2013-03-22 13:40:32 +0100 |
commit | ce867d91698a9414ff7238e902215e9b76d10459 (patch) | |
tree | ea0f66670c5317cdf4890f1eb4f9e9645e4c3fee /java/constants.h | |
parent | ad70e3fd4cda26508f00e9b549c04a5fe8831dac (diff) | |
download | MultiMC-ce867d91698a9414ff7238e902215e9b76d10459.tar MultiMC-ce867d91698a9414ff7238e902215e9b76d10459.tar.gz MultiMC-ce867d91698a9414ff7238e902215e9b76d10459.tar.lz MultiMC-ce867d91698a9414ff7238e902215e9b76d10459.tar.xz MultiMC-ce867d91698a9414ff7238e902215e9b76d10459.zip |
Port minecraft.jar version detection to Qt
Diffstat (limited to 'java/constants.h')
-rw-r--r-- | java/constants.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/java/constants.h b/java/constants.h index 2f968d2e..80697ebe 100644 --- a/java/constants.h +++ b/java/constants.h @@ -7,7 +7,7 @@ namespace java class constant { public: - enum type_t:uint8_t + enum type_t : uint8_t { j_hole = 0, // HACK: this is a hole in the array, because java is crazy j_string_data = 1, @@ -22,6 +22,7 @@ namespace java j_interface_methodref = 11, j_nameandtype = 12 } type; + constant(util::membuffer & buf ) { buf.read(type); @@ -66,10 +67,12 @@ namespace java break; } } + constant(int fake) { type = j_hole; } + std::string toString() { std::ostringstream ss; @@ -142,7 +145,8 @@ namespace java uint16_t descriptor_index; } name_and_type; }; - }; + }; + /** * A helper class that represents the custom container used in Java class file for storage of constants */ @@ -181,7 +185,7 @@ namespace java index++; } } - }; + } typedef std::vector<java::constant> container_type; /** * Access constants based on jar file index numbers (index of the first element is 1) @@ -204,5 +208,5 @@ namespace java } private: container_type constants; - }; + }; } |