File tree 1 file changed +29
-0
lines changed
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,35 @@ namespace Kumu
256
256
}
257
257
};
258
258
259
+ //
260
+ class ArchivableUi16 : public Kumu ::IArchive
261
+ {
262
+ ui16_t m_Value;
263
+
264
+ public:
265
+ ArchivableUi16 () : m_Value(0 ) {}
266
+ ArchivableUi16 (const ui16_t & value) : m_Value(value) {}
267
+ virtual ~ArchivableUi16 () {}
268
+
269
+ bool HasValue () const { return true ; }
270
+ ui32_t ArchiveLength () const { return sizeof (ui16_t ); }
271
+
272
+ bool Archive (MemIOWriter* Writer) const {
273
+ if ( Writer == 0 ) return false ;
274
+ return Writer->WriteUi16BE (m_Value);
275
+ }
276
+
277
+ bool Unarchive (MemIOReader* Reader) {
278
+ if ( Reader == 0 ) return false ;
279
+ return Reader->ReadUi16BE (&m_Value);
280
+ }
281
+
282
+ const char * EncodeString (char * str_buf, ui32_t buf_len) const {
283
+ snprintf (str_buf, buf_len, " %hu" , m_Value);
284
+ return str_buf;
285
+ }
286
+ };
287
+
259
288
//
260
289
typedef Kumu::ArchivableList<ArchivableString> StringList;
261
290
You can’t perform that action at this time.
0 commit comments