partial.cxx (b72581eb) partial.cxx (8235712b)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 105 unchanged lines hidden (view full) ---

114
115Partial::Containment Partial::contains(Path const & path) const {
116 //TODO: For set elements, the segment names recorded in the node tree need
117 // not match the corresponding path segments, so this function can fail.
118 Node const * p = &root_;
119 bool includes = false;
120 for (Path::const_iterator i(path.begin()); i != path.end(); ++i) {
121 Node::Children::const_iterator j(p->children.find(*i));
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 105 unchanged lines hidden (view full) ---

114
115Partial::Containment Partial::contains(Path const & path) const {
116 //TODO: For set elements, the segment names recorded in the node tree need
117 // not match the corresponding path segments, so this function can fail.
118 Node const * p = &root_;
119 bool includes = false;
120 for (Path::const_iterator i(path.begin()); i != path.end(); ++i) {
121 Node::Children::const_iterator j(p->children.find(*i));
122 if (j == p->children.end()) {
122 if ( j == p->children.end() )
123 {
123 break;
124 }
125 p = &j->second;
126 includes |= p->startInclude;
127 }
124 break;
125 }
126 p = &j->second;
127 includes |= p->startInclude;
128 }
128 return p->children.empty() && !p->startInclude
129 ? CONTAINS_NOT
130 : includes ? CONTAINS_NODE : CONTAINS_SUBNODES;
129 return ( ( p->children.empty() || p == &root_ )
130 && !p->startInclude )
131 ? CONTAINS_NOT
132 : ( includes ? CONTAINS_NODE : CONTAINS_SUBNODES );
131}
132
133}
133}
134
135}