2
// File: TreeExceptions.cpp
3
// Created by: Julien Dutheil
4
// Created on: Mon Nov 3 17:04:46 2003
8
Copyright or © or Copr. CNRS, (November 16, 2004)
10
Julien.Dutheil@univ-montp2.fr
12
This software is a computer program whose purpose is to provide classes
13
for phylogenetic data analysis.
15
This software is governed by the CeCILL license under French law and
16
abiding by the rules of distribution of free software. You can use,
17
modify and/ or redistribute the software under the terms of the CeCILL
18
license as circulated by CEA, CNRS and INRIA at the following URL
19
"http://www.cecill.info".
21
As a counterpart to the access to the source code and rights to copy,
22
modify and redistribute granted by the license, users are provided only
23
with a limited warranty and the software's author, the holder of the
24
economic rights, and the successive licensors have only limited
27
In this respect, the user's attention is drawn to the risks associated
28
with loading, using, modifying and/or developing or reproducing the
29
software by the user in light of its specific status of free software,
30
that may mean that it is complicated to manipulate, and that also
31
therefore means that it is reserved for developers and experienced
32
professionals having in-depth computer knowledge. Users are therefore
33
encouraged to load and test the software's suitability as regards their
34
requirements in conditions enabling the security of their systems and/or
35
data to be ensured and, more generally, to use and operate it in the
36
same conditions as regards security.
38
The fact that you are presently reading this means that you have had
39
knowledge of the CeCILL license and that you accept its terms.
42
#include "TreeExceptions.h"
46
#include <Bpp/Text/TextTools.h>
50
/******************************************************************************/
52
NodePException::NodePException(const std::string& text, const Node* node) :
53
NodeException(text, node->getId()), node_(node)
56
/******************************************************************************/
58
NodeNotFoundException::NodeNotFoundException(const std::string& text, const std::string& id) :
59
Exception("NodeNotFoundException: " + text + "(" + id + ")"),
62
NodeNotFoundException::NodeNotFoundException(const std::string& text, int id) :
63
Exception("NodeNotFoundException: " + text + "(" + TextTools::toString(id) + ")"),
64
id_(TextTools::toString(id)) {}
66
/******************************************************************************/
68
TreeException::TreeException(const std::string& text, const Tree* tree) :
69
Exception("TreeException: " + text + (tree != 0 ? "(" + tree->getName() + ")" : "")),
72
/******************************************************************************/
74
UnrootedTreeException::UnrootedTreeException(const std::string& text, const Tree* tree) :
75
TreeException("UnrootedTreeException: " + text, tree) {}
77
/******************************************************************************/