/// <summary>
        /// initalises parsing of an XML file, either a tmx (Map) file or tsx (Tileset) file
        /// </summary>
        public bool ParseXmlFile(string xmlFilename)
        {
            var parser = new CCSAXParser();

            if (false == parser.Init("UTF-8"))
            {
                return(false);
            }

            parser.SetDelegator(this);

            return(parser.Parse(xmlFilename));
        }
        public Dictionary<string, Object> DictionaryWithContentsOfFile(string pFileName)
        {
            CCSAXParser parser = new CCSAXParser();

            if (false == parser.Init("UTF-8"))
            {
                return null;
            }
            parser.SetDelegator(this);

            parser.Parse(pFileName);
            return m_pRootDict;
        }
        public bool ParseXmlString(string data)
        {
            var parser = new CCSAXParser();

            if (false == parser.Init("UTF-8"))
            {
                return(false);
            }

            parser.SetDelegator(this);

            return(parser.Parse(data, data.Length));
        }
        public Dictionary <string, Object> DictionaryWithContentsOfFile(string pFileName)
        {
            CCSAXParser parser = new CCSAXParser();

            if (false == parser.Init("UTF-8"))
            {
                return(null);
            }
            parser.SetDelegator(this);

            parser.Parse(pFileName);
            return(m_pRootDict);
        }
        public List<Object> ArrayWithContentsOfFile(string pFileName)
        {
            CCSAXParser parser = new CCSAXParser();

            if (false == parser.Init("UTF-8"))
            {
                return null;
            }
            parser.SetDelegator(this);

            //byte[] root;

            StartElement(parser, "dict", null);
            StartElement(parser, "key", null);
            TextHandler(parser, System.Text.UTF8Encoding.UTF8.GetBytes("root"), 4);
            EndElement(parser, "key");
            
            parser.Parse(pFileName);

            EndElement(parser, "dict");

            return m_pRootDict["root"] as List<Object>;
        }
        public List <Object> ArrayWithContentsOfFile(string pFileName)
        {
            CCSAXParser parser = new CCSAXParser();

            if (false == parser.Init("UTF-8"))
            {
                return(null);
            }
            parser.SetDelegator(this);

            //byte[] root;

            StartElement(parser, "dict", null);
            StartElement(parser, "key", null);
            TextHandler(parser, System.Text.UTF8Encoding.UTF8.GetBytes("root"), 4);
            EndElement(parser, "key");

            parser.Parse(pFileName);

            EndElement(parser, "dict");

            return(m_pRootDict["root"] as List <Object>);
        }
Exemple #7
0
        /// <summary>
        /// initalises parsing of an XML file, either a tmx (Map) file or tsx (Tileset) file
        /// </summary>
        public bool ParseXmlFile(string xmlFilename)
        {
            var parser = new CCSAXParser();

            if (false == parser.Init("UTF-8"))
            {
                return false;
            }

            parser.SetDelegator(this);

            return parser.Parse(xmlFilename);
        }
Exemple #8
0
        public bool ParseXmlString(string data)
        {
            var parser = new CCSAXParser();

            if (false == parser.Init("UTF-8"))
            {
                return false;
            }

            parser.SetDelegator(this);

            return parser.Parse(data, data.Length);
        }