/usr/include/fox-1.6/FXObjectList.h is in libfox-1.6-dev 1.6.53-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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | /********************************************************************************
* *
* O b j e c t L i s t *
* *
*********************************************************************************
* Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*********************************************************************************
* $Id: FXObjectList.h,v 1.31.2.1 2007/01/29 20:22:29 fox Exp $ *
********************************************************************************/
#ifndef FXOBJECTLIST_H
#define FXOBJECTLIST_H
#ifndef FXOBJECT_H
#include "FXObject.h"
#endif
namespace FX {
/// List of pointers to objects
class FXAPI FXObjectList {
protected:
FXObject **ptr;
public:
/// Default constructor
FXObjectList();
/// Copy constructor
FXObjectList(const FXObjectList& orig);
/// Construct and init with single object
FXObjectList(FXObject* object);
/// Construct and init with list of objects
FXObjectList(FXObject** objects,FXint n);
/// Assignment operator
FXObjectList& operator=(const FXObjectList& orig);
/// Return number of objects
FXint no() const { return *((FXint*)(ptr-1)); }
/// Set number of objects
void no(FXint num);
/// Indexing operator
FXObject*& operator[](FXint i){ return ptr[i]; }
FXObject* const& operator[](FXint i) const { return ptr[i]; }
/// Indexing operator
FXObject*& at(FXint i){ return ptr[i]; }
FXObject* const& at(FXint i) const { return ptr[i]; }
/// Access to content array
FXObject** data() const { return ptr; }
/// Assign object p to list
FXObjectList& assign(FXObject* object);
/// Assign n objects to list
FXObjectList& assign(FXObject** objects,FXint n);
/// Assign objects to list
FXObjectList& assign(FXObjectList& objects);
/// Insert object at certain position
FXObjectList& insert(FXint pos,FXObject* object);
/// Insert n objects at specified position
FXObjectList& insert(FXint pos,FXObject** objects,FXint n);
/// Insert objects at specified position
FXObjectList& insert(FXint pos,FXObjectList& objects);
/// Prepend object
FXObjectList& prepend(FXObject* object);
/// Prepend n objects
FXObjectList& prepend(FXObject** objects,FXint n);
/// Prepend objects
FXObjectList& prepend(FXObjectList& objects);
/// Append object
FXObjectList& append(FXObject* object);
/// Append n objects
FXObjectList& append(FXObject** objects,FXint n);
/// Append objects
FXObjectList& append(FXObjectList& objects);
/// Replace object at position by given object
FXObjectList& replace(FXint pos,FXObject* object);
/// Replaces the m objects at pos with n objects
FXObjectList& replace(FXint pos,FXint m,FXObject** objects,FXint n);
/// Replace the m objects at pos with objects
FXObjectList& replace(FXint pos,FXint m,FXObjectList& objects);
/// Remove object at pos
FXObjectList& erase(FXint pos);
/// Remove n objects at pos
FXObjectList& erase(FXint pos,FXint n);
/// Remove object
FXObjectList& remove(const FXObject* object);
/// Find object in list, searching forward; return position or -1
FXint find(const FXObject *object,FXint pos=0) const;
/// Find object in list, searching backward; return position or -1
FXint rfind(const FXObject *object,FXint pos=2147483647) const;
/// Remove all objects
FXObjectList& clear();
/// Save to a stream
void save(FXStream& store) const;
/// Load from a stream
void load(FXStream& store);
/// Destructor
virtual ~FXObjectList();
};
/// Specialize list to pointers to TYPE
template<class TYPE>
class FXObjectListOf : public FXObjectList {
public:
FXObjectListOf(){}
/// Indexing operator
TYPE*& operator[](FXint i){ return (TYPE*&)ptr[i]; }
TYPE *const& operator[](FXint i) const { return (TYPE*const&)ptr[i]; }
/// Access to list
TYPE*& at(FXint i){ return (TYPE*&)ptr[i]; }
TYPE *const& at(FXint i) const { return (TYPE*const&)ptr[i]; }
/// Access to content array
TYPE** data() const { return (TYPE**)ptr; }
};
}
#endif
|