internal static List <int> GetCSValues(string encodedValuesPath) { List <int> intList = new List <int>(); string allValues = BarcodeResources.GetAllValues(encodedValuesPath); string empty1 = string.Empty; for (int index = 0; index < allValues.Length; ++index) { char ch = allValues[index]; switch (ch) { case ' ': case ',': if (empty1.Length > 0) { int num = int.Parse(empty1); intList.Add(num); empty1 = string.Empty; break; } break; default: empty1 += (string)(object)ch; break; } } if (empty1.Length > 0) { int num = int.Parse(empty1); intList.Add(num); string empty2 = string.Empty; } return(intList); }
public static List <string> GetEncodedValues(string encodedValuesPath, int validStep) { List <string> stringList = new List <string>(); string allValues = BarcodeResources.GetAllValues(encodedValuesPath); int index1 = 0; while (index1 < allValues.Length) { switch (allValues[index1]) { case ' ': case '"': case ',': ++index1; continue; default: string empty = string.Empty; for (int index2 = 0; index2 < validStep; ++index2) { char ch = allValues[index1 + index2]; empty += ch.ToString(); } stringList.Add(empty); index1 += validStep; continue; } } return(stringList); }
internal static List <List <int> > GetBarSpaceSequence( string encodedValuesPath, int validStep) { List <int> intList = new List <int>(); List <List <int> > intListList = new List <List <int> >(); string allValues = BarcodeResources.GetAllValues(encodedValuesPath); int index1 = 0; while (index1 < allValues.Length) { switch (allValues[index1]) { case '\n': case '\r': case ' ': case '"': case ',': ++index1; break; default: string empty = string.Empty; for (int index2 = 0; index2 < validStep; ++index2) { char ch = allValues[index1 + index2]; empty += ch.ToString(); } intList.Add(int.Parse(empty)); index1 += validStep; break; } if (intList.Count == 3) { intListList.Add(new List <int>((IEnumerable <int>)intList)); intList.Clear(); } } return(intListList); }