mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-10-04 17:09:25 +00:00
Port minecraft.jar version detection to Qt
This commit is contained in:
@@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user