Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

API Class Reference

#include <switch_swigable_cpp.h>


Public Member Functions

SWITCH_DECLARE_CONSTRUCTOR API (void)
virtual SWITCH_DECLARE_CONSTRUCTOR ~API ()
const char * execute (const char *command, const char *data)
const char * executeString (const char *command)
 API (void)
virtual ~API ()
char * execute (const char *command, const char *data)
char * executeString (const char *command)

Protected Attributes

char * last_data
char * last_data


Constructor & Destructor Documentation

SWITCH_DECLARE_CONSTRUCTOR API::API void   ) 
 

00097 {
00098         last_data = NULL;
00099 }

SWITCH_DECLARE_CONSTRUCTOR API::~API  )  [virtual]
 

00102 {
00103         switch_safe_free(last_data);
00104 }

API::API void   ) 
 

virtual API::~API  )  [virtual]
 


Member Function Documentation

char* API::execute const char *  command,
const char *  data
 

const char * API::execute const char *  command,
const char *  data
 

00108 {
00109         switch_stream_handle_t stream = { 0 };
00110         this_check("");
00111         SWITCH_STANDARD_STREAM(stream);
00112         switch_api_execute(cmd, arg, NULL, &stream);
00113         last_data = (char *) stream.data;
00114         return last_data;
00115 }

Here is the call graph for this function:

char* API::executeString const char *  command  ) 
 

const char * API::executeString const char *  command  ) 
 

00118 {
00119         char *arg;
00120         switch_stream_handle_t stream = { 0 };
00121         char *mycmd = strdup(cmd);
00122 
00123         switch_assert(mycmd);
00124 
00125         this_check("");
00126 
00127         if ((arg = strchr(mycmd, ' '))) {
00128                 *arg++ = '\0';
00129         }
00130 
00131         switch_safe_free(last_data);
00132 
00133         SWITCH_STANDARD_STREAM(stream);
00134         switch_api_execute(mycmd, arg, NULL, &stream);
00135         last_data = (char *) stream.data;
00136         switch_safe_free(mycmd);
00137         return last_data;
00138 }

Here is the call graph for this function:


Field Documentation

char* API::last_data [protected]
 

char* API::last_data [protected]
 


The documentation for this class was generated from the following files:
Generated on Mon May 26 22:06:53 2008 for FreeSWITCH by  doxygen 1.3.9.1