#include <catalogxref.h>
Public Types | |
| enum | { InvalidCatalogNumber = 0xffffffff } |
Public Member Functions | |
| void | addEntry (uint32 catalogNumber, Star *star) |
| CatalogCrossReference () | |
| std::string | getPrefix () const |
| Star * | lookup (const std::string &) const |
| Star * | lookup (uint32) const |
| uint32 | parse (const std::string &) const |
| void | reserve (size_t) |
| void | setPrefix (const std::string &) |
| void | sortEntries () |
| ~CatalogCrossReference () | |
Private Attributes | |
| std::vector< Entry > | entries |
| std::string | prefix |
Classes | |
| class | Entry |
|
|
Definition at line 36 of file catalogxref.h. 00036 {
00037 InvalidCatalogNumber = 0xffffffff,
00038 };
|
|
|
Definition at line 19 of file catalogxref.cpp. 00020 {
00021 }
|
|
|
Definition at line 23 of file catalogxref.cpp. 00024 {
00025 }
|
|
||||||||||||
|
Definition at line 121 of file catalogxref.cpp. References CatalogCrossReference::Entry::catalogNumber, entries, and CatalogCrossReference::Entry::star. Referenced by ReadCatalogCrossReference(). 00122 {
00123 Entry e;
00124 e.catalogNumber = catalogNumber;
00125 e.star = star;
00126
00127 entries.insert(entries.end(), e);
00128 }
|
|
|
Definition at line 28 of file catalogxref.cpp. References prefix. 00029 {
00030 return prefix;
00031 }
|
|
|
Definition at line 76 of file catalogxref.cpp. References InvalidCatalogNumber, lookup(), and parse(). 00077 {
00078 uint32 catalogNumber = parse(name);
00079 if (catalogNumber == InvalidCatalogNumber)
00080 return NULL;
00081 else
00082 return lookup(catalogNumber);
00083 }
|
|
|
Definition at line 59 of file catalogxref.cpp. References CatalogCrossReference::Entry::catalogNumber, entries, and CatalogCrossReference::Entry::star. Referenced by lookup(). 00060 {
00061 Entry e;
00062 e.catalogNumber = catalogNumber;
00063 e.star = NULL;
00064
00065 XrefEntryPredicate pred;
00066 vector<Entry>::const_iterator iter = lower_bound(entries.begin(),
00067 entries.end(), e, pred);
00068
00069 if (iter != entries.end() && iter->catalogNumber == catalogNumber)
00070 return iter->star;
00071 else
00072 return NULL;
00073 }
|
|
|
Definition at line 86 of file catalogxref.cpp. References compareIgnoringCase(), InvalidCatalogNumber, and prefix. Referenced by lookup(). 00087 {
00088 if (compareIgnoringCase(name, prefix, prefix.length()) != 0)
00089 return InvalidCatalogNumber;
00090
00091 unsigned int i = prefix.length();
00092 unsigned int n = 0;
00093 bool readDigit = false;
00094
00095 // Optional space between prefix and number
00096 if (name[i] == ' ')
00097 i++;
00098
00099 while (isdigit(name[i]))
00100 {
00101 n = n * 10 + ((unsigned int) name[i] - (unsigned int) '0');
00102 readDigit = true;
00103
00104 // Limited to 24 bits
00105 if (n >= 0x1000000)
00106 return InvalidCatalogNumber;
00107 }
00108
00109 // Must have read at least one digit
00110 if (!readDigit)
00111 return InvalidCatalogNumber;
00112
00113 // Check for garbage at the end of the string
00114 if (i != prefix.length())
00115 return InvalidCatalogNumber;
00116 else
00117 return n;
00118 }
|
|
|
Definition at line 136 of file catalogxref.cpp. References entries. Referenced by ReadCatalogCrossReference().
|
|
|
Definition at line 33 of file catalogxref.cpp. References prefix. 00034 {
00035 prefix = _prefix;
00036 }
|
|
|
Definition at line 130 of file catalogxref.cpp. References entries. 00131 {
00132 XrefEntryPredicate pred;
00133 sort(entries.begin(), entries.end(), pred);
00134 }
|
|
|
Definition at line 50 of file catalogxref.h. Referenced by addEntry(), lookup(), reserve(), and sortEntries(). |
|
|
Definition at line 49 of file catalogxref.h. Referenced by getPrefix(), parse(), and setPrefix(). |
1.4.1