Revert "Imported Upstream version 1.2.7"
[platform/upstream/harfbuzz.git] / src / hb-ot-name-table.hh
index 75a1b94..21450c6 100644 (file)
@@ -56,7 +56,8 @@ struct NameRecord
     return 0;
   }
 
-  inline bool sanitize (hb_sanitize_context_t *c, void *base) {
+  inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
+  {
     TRACE_SANITIZE (this);
     /* We can check from base all the way up to the end of string... */
     return TRACE_RETURN (c->check_struct (this) && c->check_range ((char *) base, (unsigned int) length + offset));
@@ -74,7 +75,7 @@ struct NameRecord
 
 struct name
 {
-  static const hb_tag_t Tag    = HB_OT_TAG_name;
+  static const hb_tag_t tableTag       = HB_OT_TAG_name;
 
   inline unsigned int get_name (unsigned int platform_id,
                                unsigned int encoding_id,
@@ -98,7 +99,10 @@ struct name
     return length;
   }
 
-  inline bool sanitize_records (hb_sanitize_context_t *c) {
+  inline unsigned int get_size (void) const
+  { return min_size + count * nameRecord[0].min_size; }
+
+  inline bool sanitize_records (hb_sanitize_context_t *c) const {
     TRACE_SANITIZE (this);
     char *string_pool = (char *) this + stringOffset;
     unsigned int _count = count;
@@ -107,7 +111,8 @@ struct name
     return TRACE_RETURN (true);
   }
 
-  inline bool sanitize (hb_sanitize_context_t *c) {
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
     TRACE_SANITIZE (this);
     return TRACE_RETURN (c->check_struct (this) &&
                         likely (format == 0 || format == 1) &&
@@ -116,10 +121,9 @@ struct name
   }
 
   /* We only implement format 0 for now. */
-  protected:
   USHORT       format;                 /* Format selector (=0/1). */
   USHORT       count;                  /* Number of name records. */
-  Offset       stringOffset;           /* Offset to start of string storage (from start of table). */
+  Offset<>     stringOffset;           /* Offset to start of string storage (from start of table). */
   NameRecord   nameRecord[VAR];        /* The name records where count is the number of records. */
   public:
   DEFINE_SIZE_ARRAY (6, nameRecord);