Support structs in json_to_flatbuffer

Our JSON flatbuffer parsing code did not support structs properly.

Doing this enables easily defining lots of different layouts of
flatbuffers for more thoroughly testing flatbuffer-related changes (as
well as just making the JSON parsing more complete).

Change-Id: Ibfc7a149f9c8b314f6bbba70b4ca6b5857a8728b
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/flatbuffer_utils.h b/aos/flatbuffer_utils.h
index 0287b6d..aa22e68 100644
--- a/aos/flatbuffer_utils.h
+++ b/aos/flatbuffer_utils.h
@@ -43,6 +43,12 @@
   // Returns whether this type is an enum.
   bool IsEnum() const;
 
+  // Returns whether this type is a struct.
+  bool IsStruct() const;
+
+  // Returns whether this type is a table.
+  bool IsTable() const;
+
   // Returns whether the given field is a sequence (table, struct, or union).
   //
   // Only valid for sequences (tables, structs, or unions).
@@ -84,6 +90,7 @@
   //
   // Only valid for sequences (tables, structs, or unions).
   size_t FieldInlineSize(int index) const;
+  size_t InlineSize() const;
 
   // Returns the total number of fields.
   //
@@ -95,6 +102,16 @@
   // Only valid for sequences (tables, structs, or unions).
   FlatbufferType FieldType(int index) const;
 
+  // Returns the offset of the specified field within the struct.
+  //
+  // Only valid for structs.
+  size_t StructFieldOffset(int index) const;
+
+  // Returns the required alignment for this type.
+  size_t Alignment() const;
+  // The required alignment of the inline data for the specified field.
+  size_t FieldInlineAlignment(size_t field_index) const;
+
  private:
   explicit FlatbufferType(const reflection::Schema *schema,
                           const reflection::Object *object)