| 147 | } |
| 148 | |
| 149 | bool CPSLibrary::Save(const char* nm) |
| 150 | { |
| 151 | CMemoryWriter F; |
| 152 | |
| 153 | F.open_chunk(PS_CHUNK_VERSION); |
| 154 | F.w_u16(PS_VERSION); |
| 155 | F.close_chunk(); |
| 156 | |
| 157 | F.open_chunk(PS_CHUNK_SECONDGEN); |
| 158 | u32 chunk_id = 0; |
| 159 | for (auto it = m_PEDs.begin(); it != m_PEDs.end(); ++it, ++chunk_id) |
| 160 | { |
| 161 | F.open_chunk(chunk_id); |
| 162 | it->second->Save(F); |
| 163 | F.close_chunk(); |
| 164 | } |
| 165 | F.close_chunk(); |
| 166 | |
| 167 | F.open_chunk(PS_CHUNK_THIRDGEN); |
| 168 | chunk_id = 0; |
| 169 | for (auto g_it = m_PGDs.begin(); g_it != m_PGDs.end(); ++g_it, ++chunk_id) |
| 170 | { |
| 171 | F.open_chunk(chunk_id); |
| 172 | g_it->second->Save(F); |
| 173 | F.close_chunk(); |
| 174 | } |
| 175 | F.close_chunk(); |
| 176 | |
| 177 | return F.save_to(nm); |
| 178 | } |
| 179 | |
| 180 | void CPSLibrary::Reload() |
| 181 | { |
nothing calls this directly
no test coverage detected