Exemplo n.º 1
0
	global_variable& global_variable::operator =(uint32_t v)
	{
		assert(is_vaild());
		assert(!is_array());
		ptr_->value_ = v;
		return *this;
	}
Exemplo n.º 2
0
	bool reader::entry::extract_to_buffer(void* buf, size_t len) 
	{
		assert(is_vaild());

		if (is_directory())
			return false;

		const int open_result = unzOpenCurrentFile(zip_file());
		if (open_result != UNZ_OK)
			return false;

		bool success = true;

		const int num_bytes_read = unzReadCurrentFile(zip_file(), buf, len);
		if (num_bytes_read == 0) 
		{
			// Reached the end of the file.
		} 
		else if (num_bytes_read < 0) 
		{
			// If num_bytes_read < 0, then it's a specific UNZ_* error code.
			success = false;
		} 

		unzCloseCurrentFile(zip_file());
		return success;
	}
Exemplo n.º 3
0
	global_variable::array_entry* global_variable::entry() const
	{
		assert(is_vaild());
		assert(is_array());
		return (array_entry*)ptr_->value_; 
	}
Exemplo n.º 4
0
	global_variable::operator uint32_t const&   () const
	{
		assert(is_vaild());
		assert(!is_array());
		return ptr_->value_; 
	}
Exemplo n.º 5
0
	OPCODE_VARIABLE_TYPE global_variable::type() const
	{
		assert(is_vaild());
		return static_cast<OPCODE_VARIABLE_TYPE>(ptr_->type_);
	}