From 6e8778d6dd0f7295cecf047e57679cba595885d1 Mon Sep 17 00:00:00 2001 From: JasperVanEck Date: Fri, 29 Nov 2013 15:11:17 +0100 Subject: Changes in exceptions, to distinguish between catching and throwing exceptions. README.md of examples is doen for now --- Examples/Exceptions/exception.cpp | 48 --------------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 Examples/Exceptions/exception.cpp (limited to 'Examples/Exceptions/exception.cpp') diff --git a/Examples/Exceptions/exception.cpp b/Examples/Exceptions/exception.cpp deleted file mode 100644 index 9ccd3f7..0000000 --- a/Examples/Exceptions/exception.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/** - * exception.cpp - * @author Jasper van Eck - * - * An example file to show the working of a function which throws an exception. - * - * Exceptions haven't been implemented yet. - * Therefore this example is not yet a working one. - */ - -/** - * Libraries used. - */ -#include - -/** - * Namespace to use - */ -using namespace std; - -/** - * my_throw_exception_function() - * Throws an exception. - * @return Php::Value - */ -Php::Value my_throw_exception_function() -{ - throw Php::Exception("I threw an exception in my_throw_exception_function()"); - return "42"; -} - - -// Symbols are exported according to the "C" language -extern "C" -{ - // export the "get_module" function that will be called by the Zend engine - PHPCPP_EXPORT void *get_module() - { - // create extension - static Php::Extension extension("my_function_throw_exception","1.0"); - - // add function to extension - extension.add("my_throw_exception_function", my_throw_exception_function); - - // return the extension module - return extension.module(); - } -} -- cgit v1.2.3