Пример #1
0
        private static void GenerateOutput(List <Effects.Effect> effects, string outDirectory)
        {
            using (Formatter commonStreamWriter = new Formatter(Path.Combine(outDirectory, "EffectsCommon.abi.idl")))
            {
                OutputEffectType.OutputCommonEnums(effects, commonStreamWriter);
            }

            using (Formatter effectMakersStreamWriter = new Formatter(Path.Combine(outDirectory, "EffectMakers.cpp")))
            {
                OutputEffectType.OutputEffectMakers(effects, effectMakersStreamWriter);
            }

            foreach (var effect in effects.Where(IsEffectEnabled))
            {
                Directory.CreateDirectory(outDirectory);
                using (Formatter idlStreamWriter = new Formatter(Path.Combine(outDirectory, effect.ClassName + ".abi.idl")),
                       hStreamWriter = new Formatter(Path.Combine(outDirectory, effect.ClassName + ".h")),
                       cppStreamWriter = new Formatter(Path.Combine(outDirectory, effect.ClassName + ".cpp")))
                {
                    OutputEffectType.OutputEffectIdl(effect, idlStreamWriter);
                    OutputEffectType.OutputEffectHeader(effect, hStreamWriter);
                    OutputEffectType.OutputEffectCpp(effect, cppStreamWriter);
                }
            }
        }
Пример #2
0
        private void GenerateOutput(List <Effect> effects, string outDirectory)
        {
            using (Formatter commonStreamWriter = new Formatter(Path.Combine(outDirectory, "EffectsCommon.abi.idl")))
            {
                OutputEffectType.OutputCommonEnums(effects, commonStreamWriter);
            }

            foreach (var effect in effects)
            {
                if (effect.Uuid == null)
                {
                    continue;
                }

                Directory.CreateDirectory(outDirectory);
                using (Formatter idlStreamWriter = new Formatter(Path.Combine(outDirectory, effect.ClassName + ".abi.idl")),
                       hStreamWriter = new Formatter(Path.Combine(outDirectory, effect.ClassName + ".h")),
                       cppStreamWriter = new Formatter(Path.Combine(outDirectory, effect.ClassName + ".cpp")))
                {
                    OutputEffectType.OutputEffectIdl(effect, idlStreamWriter);
                    OutputEffectType.OutputEffectHeader(effect, hStreamWriter);
                    OutputEffectType.OutputEffectCpp(effect, cppStreamWriter);
                }
            }
        }