Panda3D
Loading...
Searching...
No Matches
iffId.I
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file iffId.I
10 * @author drose
11 * @date 2001-04-23
12 */
13
14/**
15 *
16 */
17INLINE IffId::
18IffId() {
19 _id._c[0] = 0;
20 _id._c[1] = 0;
21 _id._c[2] = 0;
22 _id._c[3] = 0;
23}
24
25/**
26 *
27 */
28INLINE IffId::
29IffId(const char id[4]) {
30 _id._c[0] = id[0];
31 _id._c[1] = id[1];
32 _id._c[2] = id[2];
33 _id._c[3] = id[3];
34}
35
36/**
37 *
38 */
39INLINE IffId::
40IffId(const IffId &copy) {
41 _id._n = copy._id._n;
42}
43
44/**
45 *
46 */
47INLINE void IffId::
48operator = (const IffId &copy) {
49 _id._n = copy._id._n;
50}
51
52/**
53 *
54 */
55INLINE bool IffId::
56operator == (const IffId &other) const {
57 return (_id._n == other._id._n);
58}
59
60/**
61 *
62 */
63INLINE bool IffId::
64operator != (const IffId &other) const {
65 return (_id._n != other._id._n);
66}
67
68/**
69 * The ordering is arbitrary, and may not even be consistent between different
70 * architectures (e.g. big-endian and little-endian). It is useful mainly
71 * for putting IffId's into a sorted container, like sets and maps.
72 */
73INLINE bool IffId::
74operator < (const IffId &other) const {
75 return (_id._n < other._id._n);
76}
77
78/**
79 * Returns the four-character name of the Id, for outputting.
80 */
81INLINE std::string IffId::
82get_name() const {
83 return std::string(_id._c, 4);
84}
A four-byte chunk ID appearing in an "IFF" file.
Definition iffId.h:26
bool operator<(const IffId &other) const
The ordering is arbitrary, and may not even be consistent between different architectures (e....
Definition iffId.I:74
std::string get_name() const
Returns the four-character name of the Id, for outputting.
Definition iffId.I:82