2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: SSPath.h /main/4 1996/08/21 15:50:49 drk $ */
29 #include "PathQualifier.h"
35 #include "dti_cc/CC_Dlist.h"
36 #include "dti_cc/cc_vvect.h"
39 // path term object class
40 // each term is made up of a SGMLGI and an optional
45 PathTerm(const Element&);
46 PathTerm(const Symbol&, PQExpr* = 0);
47 PathTerm(const char* symbol, PQExpr* = 0);
50 unsigned int operator ==(const PathTerm&);
52 const Element& element() { return f_element; };
53 const Symbol& symbol() { return f_element.gi(); };
54 PQExpr* pqexpr() { return f_PQExpr; };
56 friend ostream& operator <<(ostream&, PathTerm&);
59 const Element f_element;
63 typedef PathTerm* PathTermPtr;
65 ////////////////////////////////////////////
67 ////////////////////////////////////////////
68 class SSPath : public CC_TPtrDlist<PathTerm>
72 unsigned int f_containPathQualifier;
73 value_vector<PathTermPtr>* f_fastGetIndex;
76 SSPath(char*, unsigned int assignId); // for test purpose
80 // this call update f_containPathQualifier field
81 void appendPathTerm(PathTerm*);
83 unsigned int containSelector() { return f_containPathQualifier; };
85 // prepend p to this. Elements in p are added to this.
86 void prependPath(SSPath& p);
88 // Set up an index so that the random access to elements in the list can
89 // be O(1). No range checking is performed.
90 // Set up the index by calling fastGetIndex() before any fastGetAt() call.
92 PathTerm* fastGetAt(unsigned int i) { return (*f_fastGetIndex)[i]; };
94 friend ostream& operator<< (ostream&, SSPath&);
97 typedef CC_TPtrDlist<char> charPtrDlist;
99 extern unsigned int gGI_CASE_SENSITIVE;
102 /* DO NOT ADD ANY LINES AFTER THIS #endif */