| 124 | |
| 125 | |
| 126 | USHORT IndexJumpNode::getJumpNodeSize() const |
| 127 | { |
| 128 | /************************************** |
| 129 | * |
| 130 | * g e t J u m p N o d e S i z e |
| 131 | * |
| 132 | ************************************** |
| 133 | * |
| 134 | * Functional description |
| 135 | * Return the size needed to store |
| 136 | * this node. |
| 137 | * |
| 138 | **************************************/ |
| 139 | USHORT result = 0; |
| 140 | |
| 141 | // Size needed for prefix |
| 142 | USHORT number = prefix; |
| 143 | if (number & 0xC000) { |
| 144 | result += 3; |
| 145 | } |
| 146 | else if (number & 0xFF80) { |
| 147 | result += 2; |
| 148 | } |
| 149 | else { |
| 150 | result += 1; |
| 151 | } |
| 152 | |
| 153 | // Size needed for length |
| 154 | number = length; |
| 155 | if (number & 0xC000) { |
| 156 | result += 3; |
| 157 | } |
| 158 | else if (number & 0xFF80) { |
| 159 | result += 2; |
| 160 | } |
| 161 | else { |
| 162 | result += 1; |
| 163 | } |
| 164 | |
| 165 | // Size needed for offset |
| 166 | // NOTE! offset can be unknown when this function is called, |
| 167 | // therefor we can't use a compression method. |
| 168 | result += sizeof(USHORT); |
| 169 | // Size needed for data |
| 170 | result += length; |
| 171 | return result; |
| 172 | } |
| 173 | |
| 174 | |
| 175 | USHORT IndexNode::getNodeSize(bool leafNode) const |
no outgoing calls
no test coverage detected