/usr/include/ossim/base/ossimLookUpTable.h is in libossim-dev 2.2.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | //*******************************************************************
// Copyright (C) 2000 ImageLinks Inc.
//
// License: MIT
//
// See LICENSE.txt file in the top level directory for more details.
//
// Author: David Burken
//
// Description:
//
// Contains class declaration for LookUpTable.
//*******************************************************************
// $Id: ossimLookUpTable.h 19448 2011-04-26 15:15:07Z dburken $
#ifndef ossimLookUpTable_HEADER
#define ossimLookUpTable_HEADER
#include <vector>
#include <ossim/base/ossimConstants.h>
#include <ossim/base/ossimString.h>
#include <ossim/base/ossimKeyword.h>
#include <initializer_list>
class ossimKeywordlist;
//*******************************************************************
// CLASS: LookUpTable
//*******************************************************************
class OSSIMDLLEXPORT ossimLookUpTable
{
public:
enum
{
NOT_FOUND = -1
};
/**
* By default if you just give an initializer list with strings
* then it will assume keys 0..n-1 for each string.
*/
ossimLookUpTable(const std::initializer_list<ossimString>& stringInitializer);
virtual ~ossimLookUpTable();
/*!
* @return
* Returns the entry string associated with the entry number (key) passed
* in. Returns empty string if entry number is not in the list.
*/
virtual ossimString getEntryString(ossim_int32 entry_number) const;
/*!
* @param table_index Index into the table
* Note: This is not the key mapped to the but the index into the table.
* @return
* Returns the entry string associated with the table index passed in.
* Returns empty string if index is out of range.
*/
virtual ossimString getTableIndexString(ossim_uint32 table_index) const;
/*!
* Returns the entry string associated with the entry number passed in.
* Returns empty string if entry number is not in the list.
*/
virtual ossimString operator[](ossim_int32 entry_number) const;
/*!
* Returns the entry string associated with lookup table keyword entry
* in the Keywordlist passed in.
* Returns empty string if keyword entry is not in the Keywordlist.
*/
virtual ossimString getEntryString(const ossimKeywordlist& kwl,
const char* prefix=0) const;
/*!
* Returns the entry number associated with the entry string passed in.
* Returns NOT_FOUND(-1) if entry string is not in the list.
* If case_insensitive == true(default), the test is case insensitive;
* else, the test will be case sensitive.
*/
virtual ossim_int32 getEntryNumber(const char* entry_string,
bool case_insensitive = true) const;
/*!
* Returns the entry number associated with the lookup table keyword
* entry in the Keywordlist passed in. Returns NOT_FOUND(-1) if no
* matching entry.
* If case_insensitive == true(default), the test is case insensitive;
* else, the test will be case sensitive.
*/
virtual ossim_int32 getEntryNumber(const ossimKeywordlist& kwl,
const char* prefix=0,
bool case_insensitive = true) const;
/*!
* Returns keyword for lookups from a Keywordlist.
*/
virtual ossimKeyword getKeyword() const;
virtual ossim_uint32 getTableSize() const;
void dumpValues(std::ostream& out)const;
protected:
ossimLookUpTable(ossim_int32 table_size);
class ossimKeyValueMap
{
public:
ossimKeyValueMap(ossim_int32 key=0, const ossimString& value=""):
theKey(key),
theValue(value)
{}
void init (ossim_int32 key, const ossimString& value) { theKey=key; theValue=value; }
ossim_int32 theKey;
ossimString theValue;
};
std::vector<ossimKeyValueMap> theTable;
ossimLookUpTable(){}
};
#endif
|