0

Pjson uses these things (lines 64-123), and I'm not quite sure where to search for what they do or represent. Is there a name for it that I can google?

From the word "serialize" I thought it was some method of serialization, but according to this answer, it doesn't look at all like what it's trying to do.

//pjson.h

// This template utilizes the One Definition Rule to create global arrays in a header.
   template<typename unused=void>
   struct globals_struct
   {
      static const uint8 s_str_serialize_flags[256];
      static const double s_pow10_table[63];
      static const uint8 s_parse_flags[256];
   };
   typedef globals_struct<> globals;

   template<typename unused>
   const uint8 globals_struct<unused>::s_str_serialize_flags[256] =
   {
   //...
   };

   template<typename unused>
   const double globals_struct<unused>::s_pow10_table[63] =
   {
      // ...
   };

   // bit 0 (1) - set if: \0 cr lf " \
   // bit 1 (2) - set if: \0 cr lf
   // bit 2 (4) - set if: whitespace
   // bit 3 (8) - set if: 0-9
   // bit 4 (0x10) - set if: 0-9 e E .
   template<typename unused>
   const uint8 globals_struct<unused>::s_parse_flags[256] =
   {
     // ...
   };
MasonMac
  • 137
  • 1
  • 8

1 Answers1

0

These are lookup tables, see this first link I found on google which seems probably ok. Hope this helps.

w08r
  • 1,639
  • 13
  • 14
  • It's funny how I made look up tables before in a game, but never knew it had a term. Programming really makes you think of things you never thought of before – MasonMac Feb 20 '20 at 21:52