Ejemplo n.º 1
0
		public TypeInfo(InfoBinderInterface binder, int namespaceIndex, string localName, int baseTypeIndex, int memberBegin,
					 int memberEnd, FacetInfo[] facets, WhitespaceType whitespace)
		{
			this.namespaceIndex = namespaceIndex;
			this.localName = localName;
			this.baseTypeIndex = baseTypeIndex;
			this.memberBegin = memberBegin;
			this.memberEnd = memberEnd;
			this.facets = facets;
			this.whitespace = whitespace;
			this.binder = binder;
			this.formatter = null;
		}
Ejemplo n.º 2
0
 static FacetCheckResult Check(string value, FacetInfo facet, WhitespaceType whitespaceNormalization)
 {
     return FacetCheckResult.Fail;
 }
Ejemplo n.º 3
0
 public static bool IsEqual(string value, string normalizedCompare, WhitespaceType whitespaceNormalization)
 {
     if (whitespaceNormalization == WhitespaceType.Collapse)
     {
         bool flag  =false;
         bool pendingSpace = false;
         for (int i=0, j=0; i< value.Length; ++i)
         {
             if (IsWhitespace(value[i]))
             {
                 if (flag)
                     pendingSpace = true;
             }
             else
             {
                 flag = true;
                 if (j == normalizedCompare.Length)
                     return false;
                 if (pendingSpace)
                 {
                     if (normalizedCompare[j] != ' ')
                         return false;
                     ++j;
                     if (j == normalizedCompare.Length)
                         return false;
                     pendingSpace = false;
                 }
                 if (value[i] != normalizedCompare[j])
                     return false;
                 ++j;
             }
         }
         return true;
     }
     else if (whitespaceNormalization == WhitespaceType.Replace)
     {
         int i=0, j=0;
         for (; i< value.Length && j<normalizedCompare.Length; ++i, ++j)
         {
             if(IsWhitespace(value[i]))
             {
                 if (normalizedCompare[j] != ' ')
                     return false;
             }
             else
             {
                 if (value[i] != normalizedCompare[j])
                     return false;
             }
         }
         if((i == value.Length) != (j == normalizedCompare.Length))
             return false;
         return true;
     }
     return value == normalizedCompare;
 }
Ejemplo n.º 4
0
 public static int ComputeLength(string value, WhitespaceType whitespaceNormalization)
 {
     if (whitespaceNormalization == WhitespaceType.Collapse)
     {
         int length = 0;
         bool pendingSpace = false;
         for (int i=0; i< value.Length; i++)
         {
             if (IsWhitespace(value[i]))
             {
                 if (length != 0)
                     pendingSpace=true;
             }
             else
             {
                 if (pendingSpace)
                 {
                     length += 1;
                     pendingSpace=false;
                 }
                 length += 1;
             }
         }
         return length;
     }
     return value.Length;
 }
Ejemplo n.º 5
0
 public static FacetCheckResult Check(string s, FacetInfo facet, WhitespaceType whitespace)
 {
     return FacetCheckResult.Success;
 }
Ejemplo n.º 6
0
 public static FacetCheckResult Check(string value, FacetInfo facet, WhitespaceType whitespaceNormalization)
 {
     if (LengthFacetCheckHelper.ComputeLength(value, whitespaceNormalization) >= facet.intValue)
         return FacetCheckResult.Success;
     return FacetCheckResult.Fail;
 }
Ejemplo n.º 7
0
 public static FacetCheckResult Check(string value, FacetInfo facet, WhitespaceType whitespaceNormalization)
 {
     if (LengthFacetCheckHelper.IsEqual(value, facet.stringValue, whitespaceNormalization))
         return FacetCheckResult.EnumSuccess;
     return FacetCheckResult.EnumFail;
 }
Ejemplo n.º 8
0
			public static FacetCheckResult Check(string value, FacetInfo facet, WhitespaceType whitespaceNormalization)
			{
				if (LengthFacetCheckHelper.ComputeLength(value, whitespaceNormalization) <= facet.intValue)
					return FacetCheckResult.Success;
				return FacetCheckResult.Fail;
			}
Ejemplo n.º 9
0
			public static FacetCheckResult Check(string s, FacetInfo facet, WhitespaceType whitespace)
			{
				return FacetCheckResult.Success;
			}
Ejemplo n.º 10
0
 static FacetCheckResult Check(string value, FacetInfo facet, WhitespaceType whitespaceNormalization)
 {
     return(FacetCheckResult.Fail);
 }