/usr/include/OpenSP/Message.h is in libosp-dev 1.5.2-10ubuntu3.
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 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | // Copyright (c) 1994 James Clark
// See the file COPYING for copying permission.
#ifndef Message_INCLUDED
#define Message_INCLUDED 1
#ifdef __GNUG__
#pragma interface
#endif
#include <stddef.h>
#include "Location.h"
#include "Vector.h"
#include "CopyOwner.h"
#include "Boolean.h"
#include "StringC.h"
#include "MessageArg.h"
#ifdef SP_NAMESPACE
namespace SP_NAMESPACE {
#endif
class MessageModule;
#ifdef _MSC_VER
extern SP_API MessageModule libModule;
extern SP_API MessageModule appModule;
#else
extern MessageModule libModule;
extern MessageModule appModule;
#endif
class SP_API MessageFragment {
public:
#ifdef _MSC_VER
MessageFragment() {};
#endif
~MessageFragment();
MessageFragment(const MessageModule *module, unsigned number, const char *text = 0);
const MessageModule *module() const;
unsigned number() const;
const char *text() const;
private:
unsigned short number_;
const MessageModule * module_;
protected:
unsigned char spare_;
private:
#ifndef SP_NO_MESSAGE_TEXT
const char *text_;
#endif
};
class SP_API MessageType : public MessageFragment {
public:
enum Severity {
info,
warning,
quantityError,
idrefError,
error
};
MessageType(Severity = info, const MessageModule *module = &libModule,
unsigned number = unsigned(-1),
const char *text = 0, const char *clauses = 0,
const char *auxText = 0);
~MessageType();
Severity severity() const;
MessageFragment auxFragment() const;
Boolean isError() const;
const char *clauses() const;
private:
#ifndef SP_NO_MESSAGE_TEXT
const char *clauses_;
const char *auxText_;
#endif
};
class SP_API MessageType0 : public MessageType {
public:
MessageType0(Severity = info, const MessageModule *module = &libModule,
unsigned number = unsigned(-1), const char *text = 0,
const char *clauses = 0);
~MessageType0();
};
class SP_API MessageType1 : public MessageType {
public:
MessageType1(Severity = info, const MessageModule *module = &libModule,
unsigned number = unsigned(-1), const char *text = 0,
const char *clauses = 0);
~MessageType1();
};
class SP_API MessageType2 : public MessageType {
public:
MessageType2(Severity = info, const MessageModule *module = &libModule,
unsigned number = unsigned(-1), const char *text = 0,
const char *clauses = 0);
~MessageType2();
};
class SP_API MessageType3 : public MessageType {
public:
MessageType3(Severity = info, const MessageModule *module = &libModule,
unsigned number = unsigned(-1), const char *text = 0,
const char *clauses = 0);
~MessageType3();
};
class SP_API MessageType4 : public MessageType {
public:
MessageType4(Severity = info, const MessageModule *module = &libModule,
unsigned number = unsigned(-1), const char *text = 0,
const char *clauses = 0);
~MessageType4();
};
class SP_API MessageType5 : public MessageType {
public:
MessageType5(Severity = info, const MessageModule *module = &libModule,
unsigned number = unsigned(-1), const char *text = 0,
const char *clauses = 0);
~MessageType5();
};
class SP_API MessageType6 : public MessageType {
public:
MessageType6(Severity = info, const MessageModule *module = &libModule,
unsigned number = unsigned(-1), const char *text = 0,
const char *clauses = 0);
~MessageType6();
};
class SP_API MessageType0L : public MessageType {
public:
MessageType0L(Severity = info, const MessageModule *module = &libModule,
unsigned number = unsigned(-1), const char *text = 0,
const char *clauses = 0, const char *auxText = 0);
~MessageType0L();
};
class SP_API MessageType1L : public MessageType {
public:
MessageType1L(Severity = info, const MessageModule *module = &libModule,
unsigned number = unsigned(-1), const char *text = 0,
const char *clauses = 0, const char *auxText = 0);
~MessageType1L();
};
class SP_API OpenElementInfo {
public:
OpenElementInfo();
OpenElementInfo(OpenElementInfo const&);
inline ~OpenElementInfo() {};
PackedBoolean included;
StringC gi;
StringC matchType;
unsigned matchIndex;
};
class SP_API Message {
public:
Message();
Message(int nArgs);
const MessageType *type;
Location loc;
Location auxLoc;
Vector<CopyOwner<MessageArg> > args;
Vector<OpenElementInfo> openElementInfo;
void swap(Message &);
Boolean isError() const;
};
class SP_API Messenger {
public:
Messenger();
virtual ~Messenger();
void message(const MessageType0 &);
void message(const MessageType1 &, const MessageArg &);
void message(const MessageType2 &,
const MessageArg &,
const MessageArg &);
void message(const MessageType3 &,
const MessageArg &,
const MessageArg &,
const MessageArg &);
void message(const MessageType4 &,
const MessageArg &,
const MessageArg &,
const MessageArg &,
const MessageArg &);
void message(const MessageType5 &,
const MessageArg &,
const MessageArg &,
const MessageArg &,
const MessageArg &,
const MessageArg &);
void message(const MessageType6 &,
const MessageArg &,
const MessageArg &,
const MessageArg &,
const MessageArg &,
const MessageArg &,
const MessageArg &);
void message(const MessageType0L &, const Location &);
void message(const MessageType1L &, const MessageArg &, const Location &);
void setNextLocation(const Location &);
virtual void initMessage(Message &);
virtual void dispatchMessage(const Message &) = 0;
virtual void dispatchMessage(Message &);
private:
void doInitMessage(Message &);
Boolean haveNextLocation_;
Location nextLocation_;
};
class SP_API ForwardingMessenger : public Messenger {
public:
ForwardingMessenger(Messenger &);
void dispatchMessage(const Message &);
void dispatchMessage(Message &);
void initMessage(Message &);
private:
Messenger *to_;
};
class SP_API ParentLocationMessenger : public ForwardingMessenger {
public:
ParentLocationMessenger(Messenger &);
void initMessage(Message &);
};
class SP_API NullMessenger : public Messenger {
public:
NullMessenger();
void dispatchMessage(const Message &);
};
inline
const MessageModule *MessageFragment::module() const
{
return module_;
}
inline
unsigned MessageFragment::number() const
{
return number_;
}
inline
const char *MessageFragment::text() const
{
#ifdef SP_NO_MESSAGE_TEXT
return 0;
#else
return text_;
#endif
}
inline
MessageType::Severity MessageType::severity() const
{
return Severity(spare_);
}
inline
MessageFragment MessageType::auxFragment() const
{
return MessageFragment(module(),
number() + 1,
#ifdef SP_NO_MESSAGE_TEXT
0
#else
auxText_
#endif
);
}
inline
Boolean MessageType::isError() const
{
return severity() != info && severity() != warning;
}
inline
const char *MessageType::clauses() const
{
#ifdef SP_NO_MESSAGE_TEXT
return 0;
#else
return clauses_;
#endif
}
inline
Boolean Message::isError() const
{
return type->isError();
}
#ifdef SP_NAMESPACE
}
#endif
#endif /* not Message_INCLUDED */
|