コード例 #1
0
        private List <LocalVariableComponent> GetLocalVariableComponentList(oval_system_characteristics systemCharacteristics)
        {
            var components       = new List <LocalVariableComponent>();
            var literalComponent = new LiteralComponentType()
            {
                Value = @"\"
            };
            var objectComponent1 = new ObjectComponentType()
            {
                object_ref = "oval:org.mitre.oval:obj:5000", item_field = "name"
            };
            var objectComponent2 = new ObjectComponentType()
            {
                object_ref = "oval:org.mitre.oval:obj:6000", item_field = "name"
            };

            var objectComponentEvaluator1 = new  LocalVariableObjectComponent(objectComponent1, systemCharacteristics);
            var literalComponentEvaluator = new LocalVariableLiteralComponent(literalComponent);
            var objectComponentEvaluator2 = new  LocalVariableObjectComponent(objectComponent2, systemCharacteristics);

            components.Add(objectComponentEvaluator1);
            components.Add(literalComponentEvaluator);
            components.Add(objectComponentEvaluator2);

            return(components);
        }
コード例 #2
0
 private VariablesTypeVariableLocal_variable GetLocalVariableForRegexCaptureFunctionWithObjectComponent(string refValue, string itemFieldValue)
 {
     ObjectComponentType objectComponent = new ObjectComponentType() { object_ref = refValue, item_field = itemFieldValue };
     RegexCaptureFunctionType regexCaptureFunctionType = new RegexCaptureFunctionType() { pattern = ".", Item = objectComponent };
     VariablesTypeVariableLocal_variable localVariable = new VariablesTypeVariableLocal_variable() { Item = regexCaptureFunctionType };
     return localVariable;
 }
コード例 #3
0
        public OvalSubstringBuilder AddObjectComponent(string objectRef, string itemField)
        {
            ObjectComponentType objectComponent = new ObjectComponentType()
            {
                object_ref = objectRef, item_field = itemField
            };

            this.substringFunction.Item = objectComponent;
            return(this);
        }
コード例 #4
0
        public OvalArithmeticBuilder AddObjectComponent(string objectRef, string itemField)
        {
            ObjectComponentType objectComponent = new ObjectComponentType()
            {
                object_ref = objectRef, item_field = itemField
            };

            items.Add(objectComponent);
            return(this);
        }
コード例 #5
0
        public OvalEndBuilder AddObjectComponent(string objectRef, string itemField)
        {
            ObjectComponentType objectComponent = new ObjectComponentType()
            {
                object_ref = objectRef, item_field = itemField
            };

            endFunciton.Item = objectComponent;
            return(this);
        }
コード例 #6
0
        public OvalSplitBuilder AddObjectComponent(string objectRef, string itemField)
        {
            ObjectComponentType objectComponent = new ObjectComponentType()
            {
                object_ref = objectRef, item_field = itemField
            };

            splitFunctionType.Item = objectComponent;
            return(this);
        }
コード例 #7
0
        private static VariablesTypeVariableLocal_variable CreateALocalVariable()
        {
            VariablesTypeVariableLocal_variable variable = new VariablesTypeVariableLocal_variable();

            variable.id       = "oval:org.mitre.oval:var:4000";
            variable.datatype = Modulo.Collect.OVAL.Common.SimpleDatatypeEnumeration.@string;

            ObjectComponentType objecttype = new ObjectComponentType();

            objecttype.object_ref = "oval:org.mitre.oval:obj:3000";
            objecttype.item_field = "key";
            variable.Item         = objecttype;
            return(variable);
        }
コード例 #8
0
        private VariablesTypeVariableLocal_variable GetLocalVariableForRegexCaptureFunctionWithObjectComponent(string refValue, string itemFieldValue)
        {
            ObjectComponentType objectComponent = new ObjectComponentType()
            {
                object_ref = refValue, item_field = itemFieldValue
            };
            RegexCaptureFunctionType regexCaptureFunctionType = new RegexCaptureFunctionType()
            {
                pattern = ".", Item = objectComponent
            };
            VariablesTypeVariableLocal_variable localVariable = new VariablesTypeVariableLocal_variable()
            {
                Item = regexCaptureFunctionType
            };

            return(localVariable);
        }
コード例 #9
0
 public LocalVariableObjectComponent(ObjectComponentType objectComponent, oval_system_characteristics systemCharacteristics)
 {
     this.ObjectComponent       = objectComponent;
     this.SystemCharacteristics = systemCharacteristics;
 }