コード例 #1
0
        /// <summary>
        /// Reads the module from the specified file.
        /// </summary>
        public static CppModule Read(string file)
        {
            FileStream inputStream = new FileStream(file, FileMode.Open);
            CppModule  result      = Read(inputStream);

            inputStream.Close();

            return(result);
        }
コード例 #2
0
        public virtual bool VisitCppModule(CppModule cppModule)
        {
            if (!VisitCppElement(cppModule))
            {
                return(false);
            }

            foreach (CppInclude cppInclude in cppModule.Includes)
            {
                cppInclude.Visit(this);
            }

            return(true);
        }
コード例 #3
0
        /// <summary>
        /// Reads the module from the specified input.
        /// </summary>
        public static CppModule Read(Stream input)
        {
            CppModule     module        = null;
            XmlSerializer xmlSerializer = new XmlSerializer(typeof(CppModule));

            using (XmlReader xmlReader = XmlReader.Create(input))
            {
                module = xmlSerializer.Deserialize(xmlReader) as CppModule;
            }

            if (module != null)
            {
                module.ResetParents();
            }

            return(module);
        }