Exemple #1
0
        private HoconValue GetNode(string path)
        {
            string[]   elements    = path.Split('.');
            HoconValue currentNode = _node;

            if (currentNode == null)
            {
                if (_fallback != null)
                {
                    return(_fallback.GetNode(path));
                }

                return(null);
            }
            foreach (string key in elements)
            {
                currentNode = currentNode.GetChildObject(key);
                if (currentNode == null)
                {
                    if (_fallback != null)
                    {
                        return(_fallback.GetNode(path));
                    }

                    return(null);
                }
            }
            return(currentNode);
        }
Exemple #2
0
        private HoconValue GetNode(string path)
        {
            var        parsedPath  = path.SplitDottedPathHonouringQuotes();
            HoconValue currentNode = Root;

            if (currentNode == null)
            {
                throw new InvalidOperationException("Current node should not be null");
            }
            foreach (string key in parsedPath)
            {
                currentNode = currentNode.GetChildObject(key);
                if (currentNode == null)
                {
                    return(null);
                }
            }
            return(currentNode);
        }
Exemple #3
0
        private HoconValue GetNode(string path)
        {
            string[]   elements    = path.Split('.');
            HoconValue currentNode = Root;

            if (currentNode == null)
            {
                throw new InvalidOperationException("Current node should not be null");
            }
            foreach (string key in elements)
            {
                currentNode = currentNode.GetChildObject(key);
                if (currentNode == null)
                {
                    if (Fallback != null)
                    {
                        return(Fallback.GetNode(path));
                    }

                    return(null);
                }
            }
            return(currentNode);
        }