AcTools.LapTimes.LevelDbUtils.LevelDbInterop.leveldb_property_value C# (CSharp) Метод

leveldb_property_value() приватный Метод

private leveldb_property_value ( IntPtr db, string propname ) : IntPtr
db System.IntPtr
propname string
Результат System.IntPtr
        public static extern IntPtr leveldb_property_value(IntPtr /* DB */ db, string propname);

Usage Example

Пример #1
0
        /// <summary>
        /// DB implementations can export properties about their state
        /// via this method.  If "property" is a valid property understood by this
        /// DB implementation, fills "*value" with its current value and returns
        /// true.  Otherwise returns false.
        ///
        /// Valid property names include:
        ///
        ///  "leveldb.num-files-at-level<N>" - return the number of files at level <N>,
        ///     where <N> is an ASCII representation of a level number (e.g. "0").
        ///  "leveldb.stats" - returns a multi-line string that describes statistics
        ///     about the internal operation of the DB.
        /// </summary>
        public string PropertyValue(string name)
        {
            var ptr = LevelDbInterop.leveldb_property_value(Handle, name);

            if (ptr == IntPtr.Zero)
            {
                return(null);
            }

            try {
                return(Marshal.PtrToStringAnsi(ptr));
            } finally {
                LevelDbInterop.leveldb_free(ptr);
            }
        }