| 56 | } |
| 57 | |
| 58 | void TextData::load(cereal::PortableBinaryInputArchive& a) { |
| 59 | a(paragraphs); |
| 60 | uint32_t tStyleModCount; |
| 61 | a(tStyleModCount); |
| 62 | tStyleMods.clear(); |
| 63 | for(uint32_t i = 0; i < tStyleModCount; i++) { |
| 64 | auto& modsInPos = tStyleMods.emplace_back(); |
| 65 | uint16_t modsInPosSize; |
| 66 | a(modsInPos.pos, modsInPosSize); |
| 67 | for(uint16_t j = 0; j < modsInPosSize; j++) { |
| 68 | TextStyleModifier::ModifierType modType; |
| 69 | a(modType); |
| 70 | auto modifier = TextStyleModifier::allocate_modifier(modType); |
| 71 | a(*modifier); |
| 72 | modsInPos.mods[modType] = modifier; |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | TextData TextData::deserialize_string(std::string& s) { |
| 78 | if(s.empty()) { |