- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Utils/Exceptions/IllegalArgumentException.cpp

    00001
    00002 //
    00003 // Copyright (c) 2004           Model-based Embedded and Robotic Systems Group
    00004 // All Rights Reserved          Massachusetts Institute of Technology
    00005 //
    00006 // This software is provided as is. Model-based Embedded and Robotic Systems
    00007 // (MERS) group does not assume any responsibility.
    00008 //
    00009 // Organization:        Model-based Embedded and Robotic Systems Group
    00010 //                                      Massachusetts Institute of Technology
    00011 //
    00013
    00014 #include "IllegalArgumentException.h"
    00015
    00017
    00018 using namespace Mers::Utils::Exceptions;
    00019 using Mers::Utils::Lang::String;
    00020
    00022
    00023 #ifdef _MSC_VER
    00024 #define snprintf _snprintf
    00025 #endif
    00026
    00028
    00029 IllegalArgumentException::IllegalArgumentException(const char* argument,
    00030         const char* fileName, unsigned int lineNumber) throw()
    00031         : Exception()
    00032 {
    00033         String msg;
    00034
    00035         if(fileName != NULL) {
    00036                 msg += fileName;
    00037                 msg += ":";
    00038                 char buf[40];
    00039                 snprintf(buf, 40, "%d", lineNumber);
    00040                 msg += buf;
    00041                 msg += ": ";
    00042         }
    00043
    00044         msg += argument;
    00045         setMessage(msg);
    00046 }
    00047
    00049
    00050 IllegalArgumentException::~IllegalArgumentException() throw()
    00051 {
    00052 }
    00053
    00055