- if (m_Contents[i].m_Book != book || m_Contents[i].m_Level == 0) continue;
- x = wxINT32_SWAP_ON_BE(m_Contents[i].m_Level);
- f->Write(&x, sizeof(x));
- x = wxINT32_SWAP_ON_BE(m_Contents[i].m_ID);
- f->Write(&x, sizeof(x));
- x = wxINT32_SWAP_ON_BE(wxStrlen(m_Contents[i].m_Name) + 1);
- f->Write(&x, sizeof(x));
- WRITE_STRING(f, m_Contents[i].m_Name, x);
- x = wxINT32_SWAP_ON_BE(wxStrlen(m_Contents[i].m_Page) + 1);
- f->Write(&x, sizeof(x));
- WRITE_STRING(f, m_Contents[i].m_Page, x);
+ if (m_Contents[i].m_Book != book || m_Contents[i].m_Level == 0)
+ continue;
+ CacheWriteInt32(f, m_Contents[i].m_Level);
+ CacheWriteInt32(f, m_Contents[i].m_ID);
+ CacheWriteString(f, m_Contents[i].m_Name);
+ CacheWriteString(f, m_Contents[i].m_Page);