OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2013 University of Washington | 3 * Copyright (c) 2013 University of Washington |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 26 matching lines...) Expand all Loading... |
37 } | 37 } |
38 | 38 |
39 std::vector<std::string> nonWildcardTokens; | 39 std::vector<std::string> nonWildcardTokens; |
40 std::vector<std::size_t> nonWildcardTokenPositions; | 40 std::vector<std::size_t> nonWildcardTokenPositions; |
41 | 41 |
42 size_t nonWildcardTokenCount; | 42 size_t nonWildcardTokenCount; |
43 size_t wildcardCount = 0; | 43 size_t wildcardCount = 0; |
44 | 44 |
45 // Get the non-wildcard tokens from the Config path. | 45 // Get the non-wildcard tokens from the Config path. |
46 size_t tokenStart; | 46 size_t tokenStart; |
47 size_t asterisk = -1; | 47 size_t asterisk = (size_t)-1; |
48 do | 48 do |
49 { | 49 { |
50 // Find the non-wildcard token. | 50 // Find the non-wildcard token. |
51 tokenStart = asterisk + 1; | 51 tokenStart = asterisk + 1; |
52 asterisk = configPath.find ("*", tokenStart); | 52 asterisk = configPath.find ("*", tokenStart); |
53 | 53 |
54 // If a wildcard character was found, increment this counter. | 54 // If a wildcard character was found, increment this counter. |
55 if (asterisk != std::string::npos) | 55 if (asterisk != std::string::npos) |
56 { | 56 { |
57 wildcardCount++; | 57 wildcardCount++; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 } | 139 } |
140 } | 140 } |
141 } | 141 } |
142 | 142 |
143 // Return the wildcard matches. | 143 // Return the wildcard matches. |
144 return wildcardMatches; | 144 return wildcardMatches; |
145 } | 145 } |
146 | 146 |
147 } // namespace ns3 | 147 } // namespace ns3 |
148 | 148 |
OLD | NEW |