mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
add output_binary
This commit is contained in:
parent
7e14f2577d
commit
6552771a5f
@ -41,7 +41,7 @@ output_hex(ostream &out) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: HashVal::input
|
// Function: HashVal::input_hex
|
||||||
// Access: Published
|
// Access: Published
|
||||||
// Description: Inputs the HashVal as a 32-digit hexadecimal number.
|
// Description: Inputs the HashVal as a 32-digit hexadecimal number.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -77,6 +77,38 @@ input_hex(istream &in) {
|
|||||||
decode_hex(buffer + 24, _hv[3]);
|
decode_hex(buffer + 24, _hv[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: HashVal::output_binary
|
||||||
|
// Access: Published
|
||||||
|
// Description: Outputs the HashVal as a binary stream of bytes in
|
||||||
|
// order. This is not the same order generated by
|
||||||
|
// write_stream().
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
void HashVal::
|
||||||
|
output_binary(ostream &out) const {
|
||||||
|
StreamWriter writer(out);
|
||||||
|
writer.add_be_uint32(_hv[0]);
|
||||||
|
writer.add_be_uint32(_hv[1]);
|
||||||
|
writer.add_be_uint32(_hv[2]);
|
||||||
|
writer.add_be_uint32(_hv[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: HashVal::input_binary
|
||||||
|
// Access: Published
|
||||||
|
// Description: Inputs the HashVal as a binary stream of bytes in
|
||||||
|
// order. This is not the same order expected by
|
||||||
|
// read_stream().
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
void HashVal::
|
||||||
|
input_binary(istream &in) {
|
||||||
|
StreamReader reader(in);
|
||||||
|
_hv[0] = reader.get_be_uint32();
|
||||||
|
_hv[1] = reader.get_be_uint32();
|
||||||
|
_hv[2] = reader.get_be_uint32();
|
||||||
|
_hv[3] = reader.get_be_uint32();
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: HashVal::as_dec
|
// Function: HashVal::as_dec
|
||||||
// Access: Published
|
// Access: Published
|
||||||
|
@ -50,6 +50,8 @@ PUBLISHED:
|
|||||||
INLINE void input_dec(istream &in);
|
INLINE void input_dec(istream &in);
|
||||||
void output_hex(ostream &out) const;
|
void output_hex(ostream &out) const;
|
||||||
void input_hex(istream &in);
|
void input_hex(istream &in);
|
||||||
|
void output_binary(ostream &out) const;
|
||||||
|
void input_binary(istream &in);
|
||||||
|
|
||||||
INLINE void output(ostream &out) const;
|
INLINE void output(ostream &out) const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user