Exemple #1
0
        public static IKey CreateKey(byte[] ioBuffer, int inOffset)
        {
            var key = CKey.CreateRoot(string.Empty);

            key.BinaryDeserialize(ioBuffer, inOffset);
            return(key);
        }
Exemple #2
0
        public static CKey Build(string inRootName, List <CTokenLine> inLines, ITreeBuildSupport inSupport)
        {
            var root = CKey.CreateRoot(inRootName);

            if (inLines.Count == 0)
            {
                return(root);
            }

            CollectByDivs(root, -1, 0, inLines.Count, inLines, inSupport, root, EKeyAddingMode.AddUnique);

            if (root.KeyCount == 1 && root.GetKey(0).IsArrayKey() && root.GetKey(0).KeyCount == 0)
            {
                root.TakeAllElements(root.GetKey(0), false);
                root.GetKey(0).SetParent(null);
            }

            return(root);
        }
Exemple #3
0
        public static CKey Build(string inRootName, List <CTokenLine> inLines, ITreeBuildSupport inSupport)
        {
            var root = CKey.CreateRoot(inRootName);

            CBuildCommands commands = new CBuildCommands(inSupport.GetLogger());

            SCollectResult collect_res = Collect(root, -1, inLines, 0, inSupport, commands);

            if (!collect_res.WasRecordDivider)
            {
                root.CheckOnOneArray();
            }

            //if(root.ValuesCount == 0 && root.KeyCount == 1 && string.IsNullOrEmpty(root.Name))
            //{
            //    CKey k = root.GetKey(0);
            //    k.SetParent(null);
            //    root = k;
            //}

            return(root);
        }
Exemple #4
0
 public static IKey CreateKey(string inName)
 {
     return(CKey.CreateRoot(inName));
 }