コード例 #1
0
ファイル: QueryMatcher.cs プロジェクト: dox0/DotNet471RS3
        /// <summary>
        /// Compile this xpath to run on an external (fx) xpath engine
        /// </summary>
        internal void CompileForExternal(string xpath, XmlNamespaceManager names)
        {
            Opcode op = QueryMatcher.CompileForExternalEngine(xpath, names, null, this.match).First;

            this.query  = op;
            this.flags |= XPathFilterFlags.IsFxFilter;
        }
 internal void CompileForInternal(string xpath, XmlNamespaceManager names)
 {
     base.query = null;
     xpath = xpath.Trim();
     if (xpath.Length == 0)
     {
         base.query = matchAlwaysFilter;
         this.flags |= XPathFilterFlags.AlwaysMatch;
     }
     else if ((1 == xpath.Length) && ('/' == xpath[0]))
     {
         base.query = rootFilter.First;
         this.flags |= XPathFilterFlags.AlwaysMatch;
     }
     else
     {
         ValueDataType type;
         OpcodeBlock block = QueryMatcher.CompileForInternalEngine(xpath, names, QueryCompilerFlags.None, out type);
         if (this.match)
         {
             block.Append(new MatchResultOpcode());
         }
         else
         {
             block.Append(new QueryResultOpcode());
         }
         base.query = block.First;
     }
     this.flags &= ~XPathFilterFlags.IsFxFilter;
 }
コード例 #3
0
 internal void CompileForInternal(string xpath, XmlNamespaceManager names)
 {
     base.query = null;
     xpath      = xpath.Trim();
     if (xpath.Length == 0)
     {
         base.query  = matchAlwaysFilter;
         this.flags |= XPathFilterFlags.AlwaysMatch;
     }
     else if ((1 == xpath.Length) && ('/' == xpath[0]))
     {
         base.query  = rootFilter.First;
         this.flags |= XPathFilterFlags.AlwaysMatch;
     }
     else
     {
         ValueDataType type;
         OpcodeBlock   block = QueryMatcher.CompileForInternalEngine(xpath, names, QueryCompilerFlags.None, out type);
         if (this.match)
         {
             block.Append(new MatchResultOpcode());
         }
         else
         {
             block.Append(new QueryResultOpcode());
         }
         base.query = block.First;
     }
     this.flags &= ~XPathFilterFlags.IsFxFilter;
 }
コード例 #4
0
ファイル: QueryMatcher.cs プロジェクト: dox0/DotNet471RS3
        /// <summary>
        /// Compile for the internal engine with default flags
        /// By defalt, we compile an xpath to run stand alone, with standard optimizations
        /// </summary>
        internal void CompileForInternal(string xpath, XmlNamespaceManager names)
        {
            this.query = null;
            xpath      = xpath.Trim();

            if (0 == xpath.Length)
            {
                // Empty xpaths always match. Same for xpaths that refer to the root only
                // We will evaluate such filters with minimal overhead. However, we
                // don't want a null value for this.query, so we stick a dummy value in there
                this.query  = XPathQueryMatcher.matchAlwaysFilter;
                this.flags |= (XPathFilterFlags.AlwaysMatch);
            }
            else if (1 == xpath.Length && '/' == xpath[0])
            {
                this.query  = XPathQueryMatcher.rootFilter.First;
                this.flags |= (XPathFilterFlags.AlwaysMatch);
            }
            else
            {
                ValueDataType returnType;
                OpcodeBlock   codeBlock = QueryMatcher.CompileForInternalEngine(xpath, names, QueryCompilerFlags.None, out returnType);
                // Inject a final opcode that will place the query result on the query context
                // This query is now ready for execution STAND ALONE
                if (this.match)
                {
                    codeBlock.Append(new MatchResultOpcode());
                }
                else
                {
                    codeBlock.Append(new QueryResultOpcode());
                }

                this.query = codeBlock.First;
            }

            this.flags &= ~XPathFilterFlags.IsFxFilter;
        }
 internal void CompileForExternal(string xpath, XmlNamespaceManager names)
 {
     Opcode first = QueryMatcher.CompileForExternalEngine(xpath, names, null, this.match).First;
     base.query = first;
     this.flags |= XPathFilterFlags.IsFxFilter;
 }
コード例 #6
0
ファイル: QueryMatcher.cs プロジェクト: dox0/DotNet471RS3
 internal XPathFilterMatcher(XPathFilterMatcher matcher)
     : base(matcher)
 {
     this.flags = matcher.flags;
 }
コード例 #7
0
ファイル: QueryMatcher.cs プロジェクト: dox0/DotNet471RS3
 internal XPathQueryMatcher(bool match)
     : base()
 {
     this.flags = XPathFilterFlags.None;
     this.match = match;
 }