This file is indexed.

/usr/include/OpenMS/CONCEPT/Exception.h is in libopenms-dev 1.11.1-5.

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
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
// --------------------------------------------------------------------------
//                   OpenMS -- Open-Source Mass Spectrometry
// --------------------------------------------------------------------------
// Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
// ETH Zurich, and Freie Universitaet Berlin 2002-2013.
//
// This software is released under a three-clause BSD license:
//  * Redistributions of source code must retain the above copyright
//    notice, this list of conditions and the following disclaimer.
//  * Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the
//    documentation and/or other materials provided with the distribution.
//  * Neither the name of any author or any participating institution
//    may be used to endorse or promote products derived from this software
//    without specific prior written permission.
// For a full list of authors, refer to the file AUTHORS.
// --------------------------------------------------------------------------
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
// INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// --------------------------------------------------------------------------
// $Maintainer: Stephan Aiche$
// $Authors: Marc Sturm $
// --------------------------------------------------------------------------

#ifndef OPENMS_CONCEPT_EXCEPTION_H
#define OPENMS_CONCEPT_EXCEPTION_H

#include <OpenMS/config.h>
#include <OpenMS/CONCEPT/Types.h>

#include <new>
#include <string>
#include <sstream>

namespace OpenMS
{

  /**
      @defgroup Exceptions Exceptions

      @brief Exceptions

      @ingroup Concept
  */


  /**
      @brief %Exception namespace

      @ingroup Concept
   */
  namespace Exception
  {

    /**
        @brief Exception base class.

      This class is intended as a base class for all other exceptions.

        Each exception class should define a constructor taking a filename (string), line (int) and function name (string)
        as first agruments. This information is usually printed in case of an uncaught exception.

        To support this feature, each @em throw directive should look as follows:
        @code throw Exception::Exception(__FILE__, __LINE__, __PRETTY_FUNCTION__,...); @endcode

        @em __FILE__ and @em __LINE__ are built-in preprocessor macros that hold the desired information.
        @n @em __PRETTY_FUNCTION__ is replaced by the GNU G++ compiler with the demangled name of the current function.
        (For other compilers it is defined as "<unknown>" in config.h.)

        %OpenMS provides its own Exception::GlobalExceptionHandler::terminate() handler. This handler extracts as much
      information as possible from the exception, prints it to @em cerr , and finally calls exits the program
        cleanly (with exit code 1). This can be rather inconvenient for debugging, since you are told where the
        exception was thrown, but in general you do not know anything about the context.  Therefore
        terminate() can also create a core dump. Using a debugger (e.g. @em dbx or @em gdb) you can then create a
        stack traceback. To create a core dump, you should set the environment variable @em OPENMS_DUMP_CORE to any
        (non empty) value.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI BaseException :
      public std::exception
    {
public:

      /**	@name	Constructors and Destructors
      */
      //@{

      /// Default constructor
      BaseException() throw();

      /// Constructor
      BaseException(const char * file, int line, const char * function) throw();

      /// Constructor
      BaseException(const char * file, int line, const char * function, const std::string & name, const std::string & message) throw();

      /// Copy constructor
      BaseException(const BaseException & exception) throw();

      /// Destructor
      virtual ~BaseException() throw();
      //@}

      /**	@name	Accessors
      */
      //@{

      /// Returns the name of the exception
      const char * getName() const throw();

      /// Returns the error message of the exception
      virtual const char * what() const throw();

      /// Returns the line number where it occured
      int getLine() const throw();

      /// Returns the file where it occured
      const char * getFile() const throw();

      /// Returns the function where it occured
      const char * getFunction() const throw();

      /// Returns the message
      const char * getMessage() const throw();

      /// Modify the exception's error message
      void setMessage(const std::string & message) throw();

      //@}

protected:

      /// The source file the exception was thrown in
      const char * file_;

      /// The line number the exception was thrown in
      int                 line_;

      /// The source file the exception was thrown in
      const char * function_;

      /// The name of the exception.
      std::string name_;

      /// A more detailed description of the exception's cause.
      std::string what_;
    };

    /**
        @brief Precondition failed exception.

        A precondition (as defined by @ref OPENMS_PRECONDITION ) has failed.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI Precondition :
      public BaseException
    {
public:
      Precondition(const char * file, int line, const char * function, const std::string & condition)  throw();
    };

    /**
        @brief Postcondition failed exception.

        A postcondition (as defined by @ref OPENMS_POSTCONDITION ) has failed.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI Postcondition :
      public BaseException
    {
public:
      Postcondition(const char * file, int line, const char * function, const std::string & condition) throw();
    };

    /**
        @brief Not all required information provided.

        Information that are required are not provided.
        Especially usefull for missing MetaInfo values.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI MissingInformation :
      public BaseException
    {
public:
      MissingInformation(const char * file, int line, const char * function, const std::string & error_message) throw();
    };


    /**
        @brief Int underflow exception.

        Throw this exception to indicate an index that was smaller than
        allowed.  The constructor has two additional arguments, the values
        of which should be set to the index that caused the failure and the
        smallest allowed value to simplify debugging.

        @param	index the value of the index causing the problem
        @param	size	smallest value allowed for index

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI IndexUnderflow :
      public BaseException
    {
public:
      IndexUnderflow(const char * file, int line, const char * function, SignedSize index = 0, Size size = 0) throw();
    };

    /**
        @brief UInt underflow exception.

        Throw this exception to indicate a size was smaller than allowed.
        The constructor has an additional argument: the value of of the
        requested size.  This exception is thrown, if buffer sizes are
        insufficient.

        @param	size the size causing the problem

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI SizeUnderflow :
      public BaseException
    {
public:
      SizeUnderflow(const char * file, int line, const char * function, Size size = 0) throw();
    };

    /**
        @brief Int overflow exception.

        Throw this exception to indicate an index that was larger than
        allowed.  The constructor has two additional arguments, the values
        of which should be set to the index that caused the failure and the
        largest allowed value to simplify debugging.
        @param	index the value of the index causing the problem
        @param	size	largest value allowed for index

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI IndexOverflow :
      public BaseException
    {
public:
      IndexOverflow(const char * file, int line, const char * function, SignedSize index = 0, Size size = 0) throw();
    };

    /**
        @brief A call to an external library (other than OpenMS) went wrong.

        Throw this exception to indicate that an external library call came
        back unsuccessfull.

        @param	size the size causing the problem

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI FailedAPICall :
      public BaseException
    {
public:
      FailedAPICall(const char * file, int line, const char * function, const std::string & message) throw();
    };

    /**
        @brief Invalid range exception.

        Use this exception to indicate a general range problems.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI InvalidRange :
      public BaseException
    {
public:
      InvalidRange(const char * file, int line, const char * function) throw();
    };


    /**
        @brief Invalid UInt exception.

        Throw this exception to indicate that a size was unexpected.
        The constructor has an additional argument: the value of of the
        requested size.
        @param	size the size causing the problem

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI InvalidSize :
      public BaseException
    {
public:
      InvalidSize(const char * file, int line, const char * function, Size size = 0) throw();
    };


    /**
        @brief Out of range exception.

        Use this exception to indicate that a given value is out of a
        defined range, i. e. not within the domain of a function.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI OutOfRange :
      public BaseException
    {
public:
      OutOfRange(const char * file, int line, const char * function) throw();
    };

    /**
        @brief Invalid value exception.

        Use this exception to indicate that a given value is not valid,
        when the value is only allowed to be out of a certain set of values.
        If the value has to be inside a given range, you should rather use OutOfRange.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI InvalidValue :
      public BaseException
    {
public:
      InvalidValue(const char * file, int line, const char * function, const std::string & message, const std::string & value) throw();
    };

    /**
        @brief Exception indicating that an invalid parameter was handed over to an algorithm.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI InvalidParameter :
      public BaseException
    {
public:
      InvalidParameter(const char * file, int line, const char * function, const std::string & message) throw();
    };

    /**
        @brief Invalid conversion exception.

        This exception indicates a conversion problem when converting from
        one type to another.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI ConversionError :
      public BaseException
    {
public:
      ConversionError(const char * file, int line, const char * function, const std::string & error) throw();
    };

    /**
        @brief Illegal self operation exception.

        Throw this exception to indicate an invalid operation on the object
        itself. In general these operations are self assignments or related
        methods.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI IllegalSelfOperation :
      public BaseException
    {
public:
      IllegalSelfOperation(const char * file, int line, const char * function) throw();
    };

    /**
        @brief Null pointer argument is invalid exception.

        Use this exception to indicate a failure due to an argument not
        containing a pointer to a valid object, but a null pointer.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI NullPointer :
      public BaseException
    {
public:
      NullPointer(const char * file, int line, const char * function) throw();
    };

    /**
        @brief Invalid iterator exception.

        The iterator on which an operation should be performed was invalid.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI InvalidIterator :
      public BaseException
    {
public:
      InvalidIterator(const char * file, int line, const char * function) throw();
    };

    /**
        @brief Incompatible iterator exception.

        The iterators could not be assigned because they are bound to
        different containers.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI IncompatibleIterators :
      public BaseException
    {
public:
      IncompatibleIterators(const char * file, int line, const char * function) throw();
    };

    /**
        @brief Not implemented exception.

        This exception should be thrown to indicate not yet implemented methods.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI NotImplemented :
      public BaseException
    {
public:
      NotImplemented(const char * file, int line, const char * function) throw();
    };

    /**
        @brief Illegal tree operation exception.

        This exception is thrown to indicate that an illegal tree operation was requested.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI IllegalTreeOperation :
      public BaseException
    {
public:
      IllegalTreeOperation(const char * file, int line, const char * function) throw();
    };

    /**
        @brief Out of memory exception.

        Throw this exception to indicate that an allocation failed.
        This exception is thrown in the OPENMS new handler.
        @param	size	the number of bytes that should have been allocated
        @see GlobalException::newHandler

        @ingroup Exceptions
    */
#ifdef _MSC_VER // disable some seqan warnings that distract from ours
#   pragma warning( push ) // save warning state
#   pragma warning( disable : 4275 )
#endif
    class OPENMS_DLLAPI OutOfMemory :
      public BaseException, public std::bad_alloc
    {
public:
      OutOfMemory(const char * file, int line, const char * function, Size size = 0) throw();
    };
#ifdef _MSC_VER
#   pragma warning( pop )  // restore old warning state
#endif
    /**
        @brief Buffer overflow exception.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI BufferOverflow :
      public BaseException
    {
public:
      BufferOverflow(const char * file, int line, const char * function) throw();
    };

    /**
        @brief Division by zero error exception.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI DivisionByZero :
      public BaseException
    {
public:
      DivisionByZero(const char * file, int line, const char * function) throw();
    };

    /**
        @brief Out of grid exception.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI OutOfGrid :
      public BaseException
    {
public:
      OutOfGrid(const char * file, int line, const char * function) throw();
    };

    /**
        @brief File not found exception.

        A given file could not be found.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI FileNotFound :
      public BaseException
    {
public:
      FileNotFound(const char * file, int line, const char * function, const std::string & filename) throw();
    };

    /**
        @brief File not readable exception.

        A given file is not readable for the current user.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI FileNotReadable :
      public BaseException
    {
public:
      FileNotReadable(const char * file, int line, const char * function, const std::string & filename) throw();
    };

    /**
      @brief File not writable exception.

        A given file is not writable for the current user.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI FileNotWritable :
      public BaseException
    {
public:
      FileNotWritable(const char * file, int line, const char * function, const std::string & filename) throw();
    };

    /**
      @brief General IOException.

      General error for IO operations, that can not be associated to the more specific exceptions (e.g. FileNotWritable)

      @ingroup Exceptions
    */
    class OPENMS_DLLAPI IOException :
      public BaseException
    {
public:
      IOException(const char * file, int line, const char * function, const std::string & filename) throw();
    };

    /**
        @brief File is empty.

        A given file is empty.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI FileEmpty :
      public BaseException
    {
public:
      FileEmpty(const char * file, int line, const char * function, const std::string & filename) throw();
    };

    /**
        @brief Invalid 3-dimensional position exception.

        A given position in three dimensional is invalid.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI IllegalPosition :
      public BaseException
    {
public:
      IllegalPosition(const char * file, int line, const char * function, float x, float y, float z) throw();
    };

    /**
        @brief Parse Error exception.

        A given expression could not be parsed.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI ParseError :
      public BaseException
    {
public:
      ParseError(const char * file, int line, const char * function, const std::string & expression, const std::string & message) throw();
    };

    /**
        @brief Unable to create file exception.

        The given file could not be created.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI UnableToCreateFile :
      public BaseException
    {
public:
      UnableToCreateFile(const char * file, int line, const char * function, const std::string & filename) throw();
    };

    /**
            @brief A method or algorithm argument contains illegal values

            @ingroup Exceptions
        */
    class OPENMS_DLLAPI IllegalArgument :
      public BaseException
    {
public:
      IllegalArgument(const char * file, int line, const char * function, const std::string & error_message) throw();
    };

    /**
        @brief Element could not be found exception.

        The given element could not be found.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI ElementNotFound :
      public BaseException
    {
public:
      ElementNotFound(const char * file, int line, const char * function, const std::string & element)   throw();
    };

    /**
        @brief Exception used if an error occurred while fitting a model to a given dataset

        The given element could not be found.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI UnableToFit :
      public BaseException
    {
public:
      UnableToFit(const char * file, int line, const char * function, const std::string & name, const std::string & message) throw();
    };

    /**
        @brief Exception used if an error occurred while calibrating a dataset.

        The calibration can not be performed because not enough reference masses
                were detected.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI UnableToCalibrate :
      public BaseException
    {
public:
      UnableToCalibrate(const char * file, int line, const char * function, const std::string & name, const std::string & message) throw();
    };

    /**
        @brief Exception used if no more unique document ID's can be drawn from ID pool.

        The ID pool of OpenMS is either depleted or not existant.

        @ingroup Exceptions
    */
    class OPENMS_DLLAPI DepletedIDPool :
      public BaseException
    {
public:
      DepletedIDPool(const char * file, int line, const char * function, const std::string & name, const std::string & message) throw();
    };

  } // namespace Exception

  /**
    @brief Output operator for exceptions.

    All %OpenMS exceptions can be printed to an arbitrary output stream.
    Information written contains the exception class, the error message,
    and the location (file, line number). The following code block
    can thus be used to catch any %OpenMS exceptions and convert them to
    human readable information:
    \code
    try
    {
      .... // some code which potentially throws an exception
    }
    catch (Exception::Exception e)
    {
      Log.error() << "caught exception: " << e << std::endl;
    }
    \endcode

    @ingroup Exceptions
  */
  OPENMS_DLLAPI std::ostream & operator<<(std::ostream & os, const Exception::BaseException & e);

} // namespace OPENMS

#endif // OPENMS_CONCEPT_EXCEPTION_H