/usr/include/CEGUI/CEGUIExceptions.h is in libcegui-mk2-dev 0.7.6-2ubuntu4.
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 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 | /***********************************************************************
filename: CEGUIExceptions.h
created: 20/2/2004
author: Paul D Turner, Frederico Jeronimo (fjeronimo)
purpose: Defines exceptions used within the system
*************************************************************************/
/***************************************************************************
* Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
***************************************************************************/
#ifndef _CEGUIExceptions_h_
#define _CEGUIExceptions_h_
#include "CEGUIBase.h"
#include "CEGUIString.h"
#include <exception>
// Start of CEGUI namespace section
namespace CEGUI
{
//! Root exception class used within the GUI system.
class CEGUIEXPORT Exception : public std::exception
{
public:
//! Virtual destructor.
virtual ~Exception(void) throw();
/*!
\brief
Return a reference to the String object describing the reason for the
exception being thrown.
\return
String object containing a message describing the reason for the
exception.
*/
const String& getMessage(void) const
{ return d_message; }
/*!
\brief
Return a reference to the String object containing the exception name
(i.e. class type).
\return
String object containing the exception name.
*/
const String& getName() const
{ return d_name; }
/*!
\brief
Return a reference to the String object containing the name of the file
where the exception occurred.
\return
String object containing the name of the file where the exception
occurred.
*/
const String& getFileName(void) const
{ return d_filename; }
/*!
\brief
Return the line number where the exception occurred.
\Return
Integer representing the line number where the exception occurred.
*/
int getLine(void) const
{ return d_line; }
// override from std::exception.
const char* what() const throw();
protected:
/*!
\brief
Protected constructor that prevents instantiations (users should employ
derived exception classes instead) and that is responsible for logging
the exception.
\param message
String object describing the reason for the exception being thrown.
\param name
String object describing the exception class name
(e.g. CEGUI::UnknownObjectException)
\param filename
String object containing the name of the file where the exception
occurred.
\param line
Integer representing the line number where the exception occurred.
*/
Exception(const String& message = "",
const String& name = "CEGUI::Exception",
const String& filename = "",
int line = 0);
//! Holds the reason for the exception being thrown.
String d_message;
//! Holds the name of the file where the exception occurred.
String d_filename;
//! Holds the class name of the exception (e.g. CEGUI::ObjectInUseException)
String d_name;
//! Holds the line number where the exception occurred.
int d_line;
//! Holds the default error message.
String d_what;
};
//----------------------------------------------------------------------------//
//! Exception class used when none of the other classes are applicable
class CEGUIEXPORT GenericException : public Exception
{
public:
/*!
\brief
Constructor that is responsible for logging the generic exception by
calling the base class.
\param message
String object describing the reason for the generic exception being
thrown.
\param filename
String object containing the name of the file where the generic
exception occurred.
\param line
Integer representing the line number where the generic exception
occurred.
\remarks
The generic exception name is automatically passed to the base class as
"CEGUI::GenericException".
*/
GenericException(const String& message,
const String& file = "unknown", int line = 0) :
Exception(message, "CEGUI::GenericException", file, line)
{}
};
/*!
\brief
This helper macro ensures the correct filename and line number where the
generic exception occurred are passed to the exception itself.
\remarks
There's a bug in Visual Studio 7.1
(see http://support.microsoft.com/kb/199057/en) and lower which leads to
incorrect __LINE__ macro expansion if used inside a function and compiled
with "Program Database for Edit & Continue" (/ZI) where instead of a
constant expressing line number you'll get the following:
(__LINE__Var+constant). The workaround consists in using compiler option
"Program Database" (/Zi) instead --> Project Properties\C/C++\General\Debug
Information Format\Program Database (/Zi). Visual Studio 2005 corrects the
problem. Premake files were modified to contemplate this for VS2002 and
VS2003.
*/
#define GenericException(message) \
GenericException(message, __FILE__, __LINE__)
//----------------------------------------------------------------------------//
//! Exception class used when a request was made for an unknown object
class CEGUIEXPORT UnknownObjectException : public Exception
{
public:
/*!
\brief
Constructor that is responsible for logging the unknown object exception
by calling the base class.
\param message
String object describing the reason for the unknown object exception
being thrown.
\param filename
String object containing the name of the file where the unknown object
exception occurred.
\param line
Integer representing the line number where the unknown object exception
occurred.
\remarks
The unknown object exception name is automatically passed to the base
class as "CEGUI::UnknownObjectException".
*/
UnknownObjectException(const String& message,
const String& file = "unknown", int line = 0) :
Exception(message, "CEGUI::UnknownObjectException", file, line)
{}
};
/*!
\brief
This helper macro ensures the correct filename and line number where the
unknown object exception occurred are passed to the exception itself.
\remarks
There's a bug in Visual Studio 7.1
(see http://support.microsoft.com/kb/199057/en) and lower which leads to
incorrect __LINE__ macro expansion if used inside a function and compiled
with "Program Database for Edit & Continue" (/ZI) where instead of a
constant expressing line number you'll get the following:
(__LINE__Var+constant). The workaround consists in using compiler option
"Program Database" (/Zi) instead --> Project Properties\C/C++\General\Debug
Information Format\Program Database (/Zi). Visual Studio 2005 corrects the
problem. Premake files were modified to contemplate this for VS2002 and
VS2003.
*/
#define UnknownObjectException(message) \
UnknownObjectException(message, __FILE__, __LINE__)
//----------------------------------------------------------------------------//
//! Exception class used when some impossible request was made of the system.
class CEGUIEXPORT InvalidRequestException : public Exception
{
public:
/*!
\brief
Constructor that is responsible for logging the invalid request
exception by calling the base class.
\param message
String object describing the reason for the invalid request exception
being thrown.
\param filename
String object containing the name of the file where the invalid request
exception occurred.
\param line
Integer representing the line number where the invalid request exception
occurred.
\remarks
The invalid request exception name is automatically passed to the base
class as "CEGUI::InvalidRequestException".
*/
InvalidRequestException(const String& message,
const String& file = "unknown", int line = 0) :
Exception(message, "CEGUI::InvalidRequestException", file, line)
{}
};
/*!
\brief
This helper macro ensures the correct filename and line number where the
invalid request exception occurred are passed to the exception itself.
\remarks
There's a bug in Visual Studio 7.1
(see http://support.microsoft.com/kb/199057/en) and lower which leads to
incorrect __LINE__ macro expansion if used inside a function and compiled
with "Program Database for Edit & Continue" (/ZI) where instead of a
constant expressing line number you'll get the following:
(__LINE__Var+constant). The workaround consists in using compiler option
"Program Database" (/Zi) instead --> Project Properties\C/C++\General\Debug
Information Format\Program Database (/Zi). Visual Studio 2005 corrects the
problem. Premake files were modified to contemplate this for VS2002 and
VS2003.
*/
#define InvalidRequestException(message) \
InvalidRequestException(message, __FILE__, __LINE__)
//----------------------------------------------------------------------------//
//! Exception class used when a file handling problem occurs
class CEGUIEXPORT FileIOException : public Exception
{
public:
/*!
\brief
Constructor that is responsible for logging the file IO exception by
calling the base class.
\param message
String object describing the reason for the file IO exception being
thrown.
\param filename
String object containing the name of the file where the file IO
exception occurred.
\param line
Integer representing the line number where the file IO exception
occurred.
\remarks
The file IO exception name is automatically passed to the base class as
"CEGUI::FileIOException".
*/
FileIOException(const String& message,
const String& file = "unknown", int line = 0) :
Exception(message, "CEGUI::FileIOException", file, line)
{}
};
/*!
\brief
This helper macro ensures the correct filename and line number where the
file IO exception occurred are passed to the exception itself.
\remarks
There's a bug in Visual Studio 7.1
(see http://support.microsoft.com/kb/199057/en) and lower which leads to
incorrect __LINE__ macro expansion if used inside a function and compiled
with "Program Database for Edit & Continue" (/ZI) where instead of a
constant expressing line number you'll get the following:
(__LINE__Var+constant). The workaround consists in using compiler option
"Program Database" (/Zi) instead --> Project Properties\C/C++\General\Debug
Information Format\Program Database (/Zi). Visual Studio 2005 corrects the
problem. Premake files were modified to contemplate this for VS2002 and
VS2003.
*/
#define FileIOException(message) \
FileIOException(message, __FILE__, __LINE__)
//----------------------------------------------------------------------------//
//! Exception class used for problems in the rendering subsystem classes.
class CEGUIEXPORT RendererException : public Exception
{
public:
/*!
\brief
Constructor that is responsible for logging the renderer exception by
calling the base class.
\param message
String object describing the reason for the renderer exception being
thrown.
\param filename
String object containing the name of the file where the renderer
exception occurred.
\param line
Integer representing the line number where the renderer exception
occurred.
\remarks
The renderer exception name is automatically passed to the base class as
"CEGUI::RendererException".
*/
RendererException(const String& message,
const String& file = "unknown", int line = 0) :
Exception(message, "CEGUI::RendererException", file, line)
{}
};
/*!
\brief
This helper macro ensures the correct filename and line number where the
renderer exception occurred are passed to the exception itself.
\remarks
There's a bug in Visual Studio 7.1
(see http://support.microsoft.com/kb/199057/en) and lower which leads to
incorrect __LINE__ macro expansion if used inside a function and compiled
with "Program Database for Edit & Continue" (/ZI) where instead of a
constant expressing line number you'll get the following:
(__LINE__Var+constant). The workaround consists in using compiler option
"Program Database" (/Zi) instead --> Project Properties\C/C++\General\Debug
Information Format\Program Database (/Zi). Visual Studio 2005 corrects the
problem. Premake files were modified to contemplate this for VS2002 and
VS2003.
*/
#define RendererException(message) \
RendererException(message, __FILE__, __LINE__)
//----------------------------------------------------------------------------//
/*!
\brief
Exception class used when an attempt is made create a named object of a
particular type when an object of the same type already exists with the same
name.
*/
class CEGUIEXPORT AlreadyExistsException : public Exception
{
public:
/*!
\brief
Constructor that is responsible for logging the already exists exception
by calling the base class.
\param message
String object describing the reason for the already exists exception
being thrown.
\param filename
String object containing the name of the file where the already exists
exception occurred.
\param line
Integer representing the line number where the already exists exception
occurred.
\remarks
The already exists exception name is automatically passed to the base
class as "CEGUI::AlreadyExistsException".
*/
AlreadyExistsException(const String& message,
const String& file = "unknown", int line = 0) :
Exception(message, "CEGUI::AlreadyExistsException", file, line)
{}
};
/*!
\brief
This helper macro ensures the correct filename and line number where the
already exists exception occurred are passed to the exception itself.
\remarks
There's a bug in Visual Studio 7.1
(see http://support.microsoft.com/kb/199057/en) and lower which leads to
incorrect __LINE__ macro expansion if used inside a function and compiled
with "Program Database for Edit & Continue" (/ZI) where instead of a
constant expressing line number you'll get the following:
(__LINE__Var+constant). The workaround consists in using compiler option
"Program Database" (/Zi) instead --> Project Properties\C/C++\General\Debug
Information Format\Program Database (/Zi). Visual Studio 2005 corrects the
problem. Premake files were modified to contemplate this for VS2002 and
VS2003.
*/
#define AlreadyExistsException(message) \
AlreadyExistsException(message, __FILE__, __LINE__)
//----------------------------------------------------------------------------//
//! Exception class used when a memory handling error is detected
class CEGUIEXPORT MemoryException : public Exception
{
public:
/*!
\brief
Constructor that is responsible for logging the memory exception by
calling the base class.
\param message
String object describing the reason for the memory exception being
thrown.
\param filename
String object containing the name of the file where the memory exception
occurred.
\param line
Integer representing the line number where the memory exception
occurred.
\remarks
The memory exception name is automatically passed to the base class as
"CEGUI::MemoryException".
*/
MemoryException(const String& message,
const String& file = "unknown", int line = 0) :
Exception(message, "CEGUI::MemoryException", file, line)
{}
};
/*!
\brief
This helper macro ensures the correct filename and line number where the
memory exception occurred are passed to the exception itself.
\remarks
There's a bug in Visual Studio 7.1
(see http://support.microsoft.com/kb/199057/en) and lower which leads to
incorrect __LINE__ macro expansion if used inside a function and compiled
with "Program Database for Edit & Continue" (/ZI) where instead of a
constant expressing line number you'll get the following:
(__LINE__Var+constant). The workaround consists in using compiler option
"Program Database" (/Zi) instead --> Project Properties\C/C++\General\Debug
Information Format\Program Database (/Zi). Visual Studio 2005 corrects the
problem. Premake files were modified to contemplate this for VS2002 and
VS2003.
*/
#define MemoryException(message) \
MemoryException(message, __FILE__, __LINE__)
//----------------------------------------------------------------------------//
//! Exception class used when some required object or parameter is null
class CEGUIEXPORT NullObjectException : public Exception
{
public:
/*!
\brief
Constructor that is responsible for logging the null object exception by
calling the base class.
\param message
String object describing the reason for the null object exception being
thrown.
\param filename
String object containing the name of the file where the null object
exception occurred.
\param line
Integer representing the line number where the null object exception
occurred.
\remarks
The null object exception name is automatically passed to the base class
as "CEGUI::NullObjectException".
*/
NullObjectException(const String& message,
const String& file = "unknown", int line = 0) :
Exception(message, "CEGUI::NullObjectException", file, line)
{}
};
/*!
\brief
This helper macro ensures the correct filename and line number where the
null object exception occurred are passed to the exception itself.
\remarks
There's a bug in Visual Studio 7.1
(see http://support.microsoft.com/kb/199057/en) and lower which leads to
incorrect __LINE__ macro expansion if used inside a function and compiled
with "Program Database for Edit & Continue" (/ZI) where instead of a
constant expressing line number you'll get the following:
(__LINE__Var+constant). The workaround consists in using compiler option
"Program Database" (/Zi) instead --> Project Properties\C/C++\General\Debug
Information Format\Program Database (/Zi). Visual Studio 2005 corrects the
problem. Premake files were modified to contemplate this for VS2002 and
VS2003.
*/
#define NullObjectException(message) \
NullObjectException(message, __FILE__, __LINE__)
//----------------------------------------------------------------------------//
/*!
\brief
Exception class used when some attempt to delete, remove, or otherwise
invalidate some object that is still in use occurs.
*/
class CEGUIEXPORT ObjectInUseException : public Exception
{
public:
/*!
\brief
Constructor that is responsible for logging the object in use exception
by calling the base class.
\param message
String object describing the reason for the object in use exception
being thrown.
\param filename
String object containing the name of the file where the object in use
exception occurred.
\param line
Integer representing the line number where the object in use exception
occurred.
\remarks
The object in use exception name is automatically passed to the base
class as "CEGUI::ObjectInUseException".
*/
ObjectInUseException(const String& message,
const String& file = "unknown", int line = 0) :
Exception(message, "CEGUI::ObjectInUseException", file, line)
{}
};
/*!
\brief
This helper macro ensures the correct filename and line number where the
object in use exception occurred are passed to the exception itself.
\remarks
There's a bug in Visual Studio 7.1
(see http://support.microsoft.com/kb/199057/en) and lower which leads to
incorrect __LINE__ macro expansion if used inside a function and compiled
with "Program Database for Edit & Continue" (/ZI) where instead of a
constant expressing line number you'll get the following:
(__LINE__Var+constant). The workaround consists in using compiler option
"Program Database" (/Zi) instead --> Project Properties\C/C++\General\Debug
Information Format\Program Database (/Zi). Visual Studio 2005 corrects the
problem. Premake files were modified to contemplate this for VS2002 and
VS2003.
*/
#define ObjectInUseException(message) \
ObjectInUseException(message, __FILE__, __LINE__)
//----------------------------------------------------------------------------//
//! Exception class used for issues in scripting subsystem.
class CEGUIEXPORT ScriptException : public Exception
{
public:
/*!
\brief
Constructor that is responsible for logging the script exception by
calling the base class.
\param message
String object describing the reason for the script exception being
thrown.
\param filename
String object containing the name of the file where the script exception
occurred.
\param line
Integer representing the line number where the script exception
occurred.
\remarks
The script exception name is automatically passed to the base class as
"CEGUI::ScriptException".
*/
ScriptException(const String& message,
const String& file = "unknown", int line = 0) :
Exception(message, "CEGUI::ScriptException", file, line)
{}
};
/*!
\brief
This helper macro ensures the correct filename and line number where the
script exception occurred are passed to the exception itself.
\remarks
There's a bug in Visual Studio 7.1
(see http://support.microsoft.com/kb/199057/en) and lower which leads to
incorrect __LINE__ macro expansion if used inside a function and compiled
with "Program Database for Edit & Continue" (/ZI) where instead of a
constant expressing line number you'll get the following:
(__LINE__Var+constant). The workaround consists in using compiler option
"Program Database" (/Zi) instead --> Project Properties\C/C++\General\Debug
Information Format\Program Database (/Zi). Visual Studio 2005 corrects the
problem. Premake files were modified to contemplate this for VS2002 and
VS2003.
*/
#define ScriptException(message) \
ScriptException(message, __FILE__, __LINE__)
//----------------------------------------------------------------------------//
} // End of CEGUI namespace section
#endif // end of guard _CEGUIExceptions_h_
|