Esempio n. 1
0
        /// <summary>
        /// Retrieves an integer value from the specified path in the configuration.
        /// </summary>
        /// <param name="path">The path that contains the value to retrieve.</param>
        /// <param name="default">The default value to return if the value doesn't exist.</param>
        /// <exception cref="InvalidOperationException">This exception is thrown if the current node is undefined.</exception>
        /// <returns>The integer value defined in the specified path.</returns>
        public virtual int GetInt(string path, int @default = 0)
        {
            HoconValue value = GetNode(path);

            if (value == null)
            {
                return(@default);
            }

            return(value.GetInt());
        }
 public static object ParseInt(HoconValue e)
 {
     return(e.GetInt());
 }
 public static object ParseShort(HoconValue e)
 {
     return((short)e.GetInt());
 }