Beispiel #1
0
 /// <summary>
 /// The word is delimeter only.
 /// </summary>
 /// <returns></returns>
 public WordCursor SetNullWord( )
 {
     mWordValue       = null;
     mWordBx          = -1;
     RelativePosition = AcRelativePosition.At;
     return(this);
 }
Beispiel #2
0
 /// <summary>
 /// Return the encapsulated value in string form.
 /// </summary>
 /// <returns></returns>
 public override string ToString( )
 {
     if (IsAtValue == false)
     {
         return(null);
     }
     else if (mAtFinalEmptyValue == true)
     {
         return(null);
     }
     else if (mCsr.Word == null)
     {
         return("");
     }
     else if (mCsr.Word.Class == WordClassification.NameBraced)
     {
         string braceName = mCsr.Word.BraceName;
         if (braceName == "_qv")
         {
             WordValue vlu = mCsr.Word.BracedValue;
             return(vlu.DequotedWord);
         }
         else
         {
             return(mCsr.Word.BracedValue.ToString( ));
         }
     }
     else
     {
         return(mCsr.Word.ToString( ));
     }
 }
Beispiel #3
0
 // ----------------------- SetWord ---------------------------------
 /// <summary>
 /// Set the value of the word and its position in the string.
 /// </summary>
 /// <param name="InWord"></param>
 /// <param name="InWordBx"></param>
 /// <returns></returns>
 public WordCursor SetWord(
     string InWord, WordClassification InClass, int InWordBx, char InBraceChar)
 {
     mWordValue       = new WordValue(InWord, InClass, mTraits, InBraceChar);
     mWordBx          = InWordBx;
     RelativePosition = AcRelativePosition.At;
     return(this);
 }
Beispiel #4
0
 /// <summary>
 /// Empty the word attributes of the cursor.
 /// </summary>
 public void EmptyWord( )
 {
     mWordValue         = null;
     mWordBx            = -1;
     mDelimBx           = -1;
     mDelim             = null;
     mRltv              = AcRelativePosition.None;
     mDelimIsWhitespace = false;
 }
Beispiel #5
0
 public WordCursor(WordCursor InWord)
 {
     mWordValue         = InWord.mWordValue;
     mWordBx            = InWord.WordBx;
     mDelimBx           = InWord.DelimBx;
     mDelim             = InWord.mDelim;
     mDelimIsWhitespace = InWord.mDelimIsWhitespace;
     mRltv   = InWord.mRltv;
     mTraits = InWord.mTraits;
     mString = InWord.mString;
 }
Beispiel #6
0
            /// <summary>
            /// Return an object holding the CsvString value.
            /// </summary>
            /// <returns></returns>
            public object ToObject( )
            {
                if (IsAtValue == false)
                {
                    return(null);
                }
                else if (mAtFinalEmptyValue == true)
                {
                    return(null);
                }
                else if (mCsr.Word == null)
                {
                    return(null);
                }
                else if (mCsr.Word.Class == WordClassification.NameBraced)
                {
                    string braceName = mCsr.Word.BraceName;
                    if (braceName == "_qv")
                    {
                        WordValue vlu = mCsr.Word.BracedValue;
                        return(vlu.DequotedWord);
                    }

                    // a string[] is stored as a sequence of strings in CsvString form.
                    else if (braceName == "_sa")                        // string array
                    {
                        CsvString vlu = new CsvString( );
                        vlu.String = mCsr.Word.BracedValue.ToString( );
                        return(vlu.ToStringArray( ));
                    }

                    // is a string of comma seperated values.
                    else if (braceName == "_csv")
                    {
                        CsvString vlu = new CsvString( );
                        vlu.String = mCsr.Word.BracedValue.ToString( );
                        return(vlu);
                    }

                    else
                    {
                        return(mCsr.Word.BracedValue.ToString( ));
                    }
                }
                else
                {
                    return(mCsr.Word.ToString( ));
                }
            }