/// <summary>
        /// Generates the code from the contents of the address space.
        /// </summary>
        public CodeGenerator(string inputPath, string outputDirectory, Dictionary <string, string> knownFiles, string resourcePath)
        {
            // load and validate type dictionary.
            m_validator = new TypeDictionaryValidator(knownFiles, resourcePath);
            m_validator.Validate(inputPath);

            // save output directory.
            m_outputDirectory      = outputDirectory;
            m_dictionariesToExport = new List <string>();
        }
Example #2
0
        /// <summary>
        /// Loads and validates the type dictionary.
        /// </summary>
        protected SchemaGenerator(string inputPath, string outputDirectory, Dictionary <string, string> knownFiles, string resourcePath)
        {
            // load and validate type dictionary.
            m_validator = new TypeDictionaryValidator(knownFiles, resourcePath);
            m_validator.Validate(inputPath);

            // save output directory.
            m_outputDirectory = outputDirectory;

            // index namespace uris.
            IndexNamespaceUris();
        }
Example #3
0
        /// <summary>
        /// Generates the code from the contents of the address space.
        /// </summary>
        public WiresharkGenerator(
            string inputPath,
            string outputDirectory,
            Dictionary <string, string> knownFiles,
            string resourcePath)
            :
            base(inputPath, outputDirectory, knownFiles, resourcePath)
        {
            // load and validate type dictionary.
            m_validator = new TypeDictionaryValidator(knownFiles, resourcePath);
            m_validator.Validate(inputPath);

            TargetLanguage    = Language.Wireshark;
            m_lstFields       = new List <HFEntry>();
            m_hashSimpleTypes = new Hashtable();

            m_hashSimpleTypes.Add("Boolean", null);
            m_hashSimpleTypes.Add("Byte", null);
            m_hashSimpleTypes.Add("SByte", null);
            m_hashSimpleTypes.Add("UInt16", null);
            m_hashSimpleTypes.Add("Int16", null);
            m_hashSimpleTypes.Add("UInt32", null);
            m_hashSimpleTypes.Add("Int32", null);
            m_hashSimpleTypes.Add("UInt64", null);
            m_hashSimpleTypes.Add("Int64", null);
            m_hashSimpleTypes.Add("Float", null);
            m_hashSimpleTypes.Add("Double", null);
            m_hashSimpleTypes.Add("Counter", null);
            m_hashSimpleTypes.Add("IntegerId", null);
            m_hashSimpleTypes.Add("String", null);
            m_hashSimpleTypes.Add("Duration", null);
            m_hashSimpleTypes.Add("DateTime", null);
            m_hashSimpleTypes.Add("UtcTime", null);
            m_hashSimpleTypes.Add("Guid", null);
            m_hashSimpleTypes.Add("StatusCode", null);
            m_hashSimpleTypes.Add("ByteString", null);
            m_hashSimpleTypes.Add("XmlElement", null);

            m_sHeader = "/******************************************************************************\n" +
                        "** $Id$\n" +
                        "**\n" +
                        "** Copyright (C) 2006-2008 ascolab GmbH. All Rights Reserved.\n" +
                        "** Web: http://www.ascolab.com\n" +
                        "** \n" +
                        "** This program is free software; you can redistribute it and/or\n" +
                        "** modify it under the terms of the GNU General Public License\n" +
                        "** as published by the Free Software Foundation; either version 2\n" +
                        "** of the License, or (at your option) any later version.\n" +
                        "** \n" +
                        "** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE\n" +
                        "** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\n" +
                        "** \n" +
                        "** Project: OpcUa Wireshark Plugin\n" +
                        "**\n" +
                        "** Description: {0}\n" +
                        "**\n" +
                        "** DON'T MODIFY THIS FILE!\n" +
                        "**\n" +
                        "******************************************************************************/\n" +
                        "\n";
        }