MaterialsOptimizer.Parser.ReadString C# (CSharp) Method

ReadString() public method

public ReadString ( bool _UnQuote, bool _unSemiColon ) : string
_UnQuote bool
_unSemiColon bool
return string
        public string ReadString( bool _UnQuote, bool _unSemiColon )
        {
            if ( !SkipSpaces() )
                return null;
            int	StartIndex = m_Index;
            while ( OK && !IsSpace() && !IsEOL() ) {
                m_Index++;
            }

            string	Result = m_Content.Substring( StartIndex, m_Index-StartIndex );
            if ( _UnQuote )
                Result = UnQuote( Result, _unSemiColon );
            return Result;
        }

Same methods

Parser::ReadString ( ) : string

Usage Example

Example #1
0
        public float4   ReadFloat4(string _block)
        {
            Parser P = new Parser(_block);

            float4 Result = new float4();

            int coordinateIndex = 0;

            while (P.OK)
            {
                float value = P.ReadFloat();
                P.ReadString();                 // Skip separator

                switch (coordinateIndex)
                {
                case 0: Result.x = value; break;

                case 1: Result.y = value; break;

                case 2: Result.z = value; break;

                case 3: Result.w = value; break;

                default: Error("Unexpected coordinate!"); break;
                }

                coordinateIndex++;
            }
            return(Result);
        }
All Usage Examples Of MaterialsOptimizer.Parser::ReadString