Beispiel #1
0
        /// <summary> Returns given group serialized as a pipe-encoded string - this method is called
        /// by encode(Message source, String encoding).
        /// </summary>
        public static System.String encode(Group source, EncodingCharacters encodingChars)
        {
            System.Text.StringBuilder result = new System.Text.StringBuilder();

            System.String[] names = source.Names;
            for (int i = 0; i < names.Length; i++)
            {
                Structure[] reps = source.getAll(names[i]);
                for (int rep = 0; rep < reps.Length; rep++)
                {
                    if (reps[rep] is Group)
                    {
                        result.Append(encode((Group)reps[rep], encodingChars));
                    }
                    else
                    {
                        System.String segString = encode((Segment)reps[rep], encodingChars);
                        if (segString.Length >= 4)
                        {
                            result.Append(segString);
                            result.Append('\r');
                        }
                    }
                }
            }
            return(result.ToString());
        }
Beispiel #2
0
 /// <summary> Returns given group serialized as a pipe-encoded string - this method is called
 /// by encode(Message source, String encoding).
 /// </summary>
 protected virtual void encode(Group source, EncodingCharacters encodingChars, Table tbl)
 {
     System.String[] names = source.Names;
     for (int i = 0; i < names.Length; i++)
     {
         Structure[] reps = source.getAll(names[i]);
         for (int rep = 0; rep < reps.Length; rep++)
         {
             if (reps[rep] is Group)
             {
                 Group g = (Group)reps[rep];
                 encode(g, encodingChars, tbl);
             }
             else
             {
                 Segment segment = (Segment)reps[rep];
                 encode(segment, encodingChars, tbl);
             }
         }
     }
 }
        /// <summary> Returns given group serialized as a pipe-encoded string - this method is called
        /// by encode(Message source, String encoding).
        /// </summary>
        protected virtual void encode(Group source, EncodingCharacters encodingChars, Table tbl)
        {
            System.String[] names = source.Names;
            for (int i = 0; i < names.Length; i++)
            {
                Structure[] reps = source.getAll(names[i]);
                for (int rep = 0; rep < reps.Length; rep++)
                {
                    if (reps[rep] is Group)
                    {
                        Group g = (Group)reps[rep];
                        encode(g, encodingChars, tbl);

                    }
                    else
                    {
                        Segment segment = (Segment)reps[rep];
                        encode(segment, encodingChars, tbl);
                    }
                }
            }
        }
Beispiel #4
0
        /// <summary> Returns given group serialized as a pipe-encoded string - this method is called
        /// by encode(Message source, String encoding).
        /// </summary>
        public static System.String encode(Group source, EncodingCharacters encodingChars)
        {
            System.Text.StringBuilder result = new System.Text.StringBuilder();

            System.String[] names = source.Names;
            for (int i = 0; i < names.Length; i++)
            {
                Structure[] reps = source.getAll(names[i]);
                for (int rep = 0; rep < reps.Length; rep++)
                {
                    if (reps[rep] is Group)
                    {
                        result.Append(encode((Group) reps[rep], encodingChars));
                    }
                    else
                    {
                        System.String segString = encode((Segment) reps[rep], encodingChars);
                        if (segString.Length >= 4)
                        {
                            result.Append(segString);
                            result.Append('\r');
                        }
                    }
                }
            }
            return result.ToString();
        }