BitOrchestra.Parser.AcceptOption C# (CSharp) Method

AcceptOption() public static method

Tries parsing an option and applying it to the given sound options structure.
public static AcceptOption ( string Text, int &Index, SoundOptions Options, int &ErrorIndex ) : bool
Text string
Index int
Options SoundOptions
ErrorIndex int
return bool
        public static bool AcceptOption(string Text, ref int Index, SoundOptions Options, out int ErrorIndex)
        {
            string optname = null;
            int optvalue = 0;
            if (AcceptOption(Text, ref Index, ref optname, ref optvalue, out ErrorIndex))
            {
                switch (optname)
                {
                    case "rate":
                        Options.Rate = optvalue;
                        break;
                    case "offset":
                        Options.Offset = optvalue;
                        break;
                    case "length":
                        Options.Length = optvalue;
                        break;
                    case "resolution":
                        Options.Resolution = optvalue;
                        break;
                    default:
                        break;
                }
                return true;
            }
            return false;
        }

Same methods

Parser::AcceptOption ( string Text, int &Index, string &Name, int &Value, int &ErrorIndex ) : bool