#ifndef __SITECING_SITECING_EXCEPTION_H #define __SITECING_SITECING_EXCEPTION_H #include /** * @file * @brief The site-C-ing specific exception. */ namespace sitecing { /** * The comonent failed to link. */ class link_error : public konforka::exception { public: /** * The component path */ string component_path; /** * @param w the message. * @param cp component path. */ link_error(const string& w,const string& cp) : konforka::exception(NOCODEPOINT,w), component_path(cp) { } /** * @param fi the file name where the exception is thrown from. * @param fu the function name where the exception originates from. * @param l the line number where the exception originates from. * @param w the message. * @param cp component path. */ link_error(const string& fi,const string& fu,int l,const string& w,const string& cp) : konforka::exception(fi,fu,l,w), component_path(cp) { } ~link_error() throw() { } }; /** * The component failed to compile. */ class compile_error : public konforka::exception { public: /** * The component path */ string component_path; /** * @param w the message. * @param cp component path. */ compile_error(const string& w,const string& cp) : konforka::exception(NOCODEPOINT,w), component_path(cp) { } /** * @param whe point in code. * @param wha the message. * @param cp component path. */ compile_error(const string &whe,const string& wha,const string& cp) : konforka::exception(whe,wha), component_path(cp) { } /** * @param fi the file name where the exception is thrown from. * @param fu the function name where the exception originates from. * @param l the line number where the exception originates from. * @param w the message. * @param cp component path. */ compile_error(const string &fi,const string& fu,int l,const string& w,const string& cp) : konforka::exception(fi,fu,l,w), component_path(cp) { } ~compile_error() throw() { } }; /** * Failed to preprocess component source. */ class preprocessor_error : public konforka::exception { public: /** * Component name. */ string component_name; /** * The line number of the source code where the error occured. */ int line_number; /** * @param fi file name where the exception originates from. * @param fu the function name where the exception originates from. * @param l the line number where the exception originate from. * @param w the error message. * @param cn the component name. * @param ln the line of the component source where the error occured. */ preprocessor_error(const string& fi,const string& fu,int l,const string& w,const string& cn,int ln) : konforka::exception(fi,fu,l,w), component_name(cn), line_number(ln) { } /** * @param fi file name where the exception originates from. * @param fu the function name where the exception originates from. * @param l the line number where the exception originate from. * @param w the error message. * @param cn the component name. */ preprocessor_error(const string& fi,const string& fu,int l,const string& w,const string& cn) : konforka::exception(fi,fu,l,w), component_name(cn), line_number(-1) { } /** * @param fi file name where the exception originates from. * @param fu the function name where the exception originates from. * @param l the line number where the exception originate from. * @param w the error message. * @param ln the line of the component source where the error occured. */ preprocessor_error(const string& fi,const string& fu,int l,const string& w,int ln) : konforka::exception(fi,fu,l,w), line_number(ln) { } /** * @param fi file name where the exception originates from. * @param fu the function name where the exception originates from. * @param l the line number where the exception originate from. * @param w the error message. */ preprocessor_error(const string& fi,const string& fu,int l,const string& w) : konforka::exception(fi,fu,l,w), line_number(-1) { } ~preprocessor_error() throw() {} }; } #endif /* __SITECING_SITECING_EXCEPTION_H */