Esempio n. 1
0
        public ReadOnlySpan <byte> GetRaw(ReadOnlySpan <byte> defaultValue)
        {
            var entry = NtCore.GetEntryValue(Handle);

            if (entry.Type == NtType.Raw)
            {
                return(entry.Data.VRaw.AsSpan());
            }
            return(defaultValue);
        }
Esempio n. 2
0
        public string GetString(string defaultValue)
        {
            var entry = NtCore.GetEntryValue(Handle);

            if (entry.Type == NtType.String)
            {
                return(entry.Data.VString !);
            }
            return(defaultValue);
        }
Esempio n. 3
0
        public ReadOnlySpan <char> GetString(ReadOnlySpan <char> defaultValue)
        {
            var entry = NtCore.GetEntryValue(Handle);

            if (entry.Type == NtType.String)
            {
                return(entry.Data.VString.AsSpan());
            }
            return(defaultValue);
        }
Esempio n. 4
0
        public bool GetBoolean(bool defaultValue)
        {
            var entry = NtCore.GetEntryValue(Handle);

            if (entry.Type == NtType.Boolean)
            {
                return(entry.Data.VBoolean);
            }
            return(defaultValue);
        }
Esempio n. 5
0
        public double GetDouble(double defaultValue)
        {
            var entry = NtCore.GetEntryValue(Handle);

            if (entry.Type == NtType.Double)
            {
                return(entry.Data.VDouble);
            }
            return(defaultValue);
        }
Esempio n. 6
0
        public ReadOnlySpan <string> GetStringArray(ReadOnlySpan <string> defaultValue)
        {
            var entry = NtCore.GetEntryValue(Handle);

            if (entry.Type == NtType.StringArray)
            {
                return(entry.Data.VStringArray.AsSpan());
            }
            return(defaultValue);
        }
Esempio n. 7
0
        public ReadOnlySpan <double> GetDoubleArray(ReadOnlySpan <double> defaultValue)
        {
            var entry = NtCore.GetEntryValue(Handle);

            if (entry.Type == NtType.DoubleArray)
            {
                return(entry.Data.VDoubleArray.AsSpan());
            }
            return(defaultValue);
        }
Esempio n. 8
0
        public ReadOnlySpan <bool> GetBooleanArray(ReadOnlySpan <bool> defaultValue)
        {
            var entry = NtCore.GetEntryValue(Handle);

            if (entry.Type == NtType.BooleanArray)
            {
                return(entry.Data.VBooleanArray.AsSpan());
            }
            return(defaultValue);
        }
Esempio n. 9
0
        ///<inheritdoc/>
        public Value GetValue(string key, Value defaultValue)
        {
            string localPath = m_path + PathSeperatorChar + key;
            var    v         = NtCore.GetEntryValue(localPath);

            if (v == null)
            {
                return(defaultValue);
            }
            return(v);
        }
Esempio n. 10
0
        public Value GetValue(string key)
        {
            string localPath = m_path + PathSeperatorChar + key;
            var    v         = NtCore.GetEntryValue(localPath);

            if (v == null)
            {
                throw new TableKeyNotDefinedException(localPath);
            }
            return(v);
        }
Esempio n. 11
0
        public object?GetObjectValue()
        {
            var v = NtCore.GetEntryValue(Handle);

            return(v.GetValue());
        }
Esempio n. 12
0
 public NetworkTableValue GetValue()
 {
     return(new NetworkTableValue(NtCore.GetEntryValue(Handle)));
 }