/// <summary> /// 2.2.7.1.8 /// </summary> /// <param name="glyph"></param> public void VerifyStructure(TS_GLYPHCACHE_CAPABILITYSET glyph) { site.CaptureRequirementIfAreEqual<capabilitySetType_Values>(capabilitySetType_Values.CAPSTYPE_GLYPHCACHE, glyph.capabilitySetType, 1342, @"In TS_GLYPHCACHE_CAPABILITYSET structure, capabilitySetType field MUST be set to CAPSTYPE_GLYPHCACHE (16)."); site.CaptureRequirementIfIsTrue(glyph.FragCache.CacheEntries <= 256, 1346, @"In TS_GLYPHCACHE_CAPABILITYSET structure, the maximum number of entries allowed in a FragCache is" + @" 256, and the largest allowed maximum size of an element is 256 bytes."); bool isR1348Satisfied = glyph.GlyphSupportLevel == GlyphSupportLevel_Values.GLYPH_SUPPORT_NONE || glyph.GlyphSupportLevel == GlyphSupportLevel_Values.GLYPH_SUPPORT_PARTIAL || glyph.GlyphSupportLevel == GlyphSupportLevel_Values.GLYPH_SUPPORT_FULL || glyph.GlyphSupportLevel == GlyphSupportLevel_Values.GLYPH_SUPPORT_ENCODE; site.CaptureRequirementIfIsTrue(isR1348Satisfied, 1348, @"In TS_GLYPHCACHE_CAPABILITYSET structure, the GlyphSupportLevel field can be the following " + @"GLYPH_SUPPORT_NONE 0,GLYPH_SUPPORT_PARTIAL 1,GLYPH_SUPPORT_FULL 2,GLYPH_SUPPORT_ENCODE 3"); }
/// <summary> /// Parse TS_GLYPHCACHE_CAPABILITYSET /// </summary> /// <param name="data">data to be parsed</param> /// <returns>TS_GLYPHCACHE_CAPABILITYSET</returns> private TS_GLYPHCACHE_CAPABILITYSET ParseCapsTypeGlyphCache(byte[] data) { int currentIndex = 0; TS_GLYPHCACHE_CAPABILITYSET set = new TS_GLYPHCACHE_CAPABILITYSET(); set.capabilitySetType = (capabilitySetType_Values)ParseUInt16(data, ref currentIndex, false); set.lengthCapability = ParseUInt16(data, ref currentIndex, false); set.GlyphCache = new TS_CACHE_DEFINITION[10]; for (int i = 0; i < 10; i++) { set.GlyphCache[i] = ParseGlyphCache(data, ref currentIndex); } set.FragCache = ParseFragCache(data, ref currentIndex); set.GlyphSupportLevel = (GlyphSupportLevel_Values)ParseUInt16(data, ref currentIndex, false); set.pad2octets = ParseUInt16(data, ref currentIndex, false); VerifyDataLength(data.Length, currentIndex, ConstValue.ERROR_MESSAGE_DATA_LENGTH_INCONSISTENT); return set; }