/src/libetonyek/src/lib/IWORKTokenizerBase.cpp
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* |
3 | | * This file is part of the libetonyek project. |
4 | | * |
5 | | * This Source Code Form is subject to the terms of the Mozilla Public |
6 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
8 | | */ |
9 | | |
10 | | #include "IWORKTokenizerBase.h" |
11 | | |
12 | | namespace libetonyek |
13 | | { |
14 | | |
15 | | int IWORKTokenizerBase::getId(const char *const name) const |
16 | 791 | { |
17 | 791 | if (!name || (0 == name[0])) |
18 | 0 | return 0; |
19 | | |
20 | 791 | return queryId(name); |
21 | 791 | } |
22 | | |
23 | | int IWORKTokenizerBase::getQualifiedId(const char *const name, const char *const ns) const |
24 | 908 | { |
25 | 908 | if (!name || (0 == name[0])) |
26 | 0 | return 0; |
27 | | |
28 | 908 | if (!ns || (0 == ns[0])) |
29 | 791 | return getId(name); |
30 | | |
31 | 117 | const int nameId = queryId(name); |
32 | 117 | const int nsId = queryId(ns); |
33 | | |
34 | 117 | return ((0 == nameId) || (0 == nsId)) ? 0 : (nsId | nameId); |
35 | 908 | } |
36 | | |
37 | | } |
38 | | |
39 | | /* vim:set shiftwidth=2 softtabstop=2 expandtab: */ |