Template object for StateVarComplete.
This commit is contained in:
parent
2616d4c76a
commit
942e0ec809
@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
#ifndef STATEVARCOMPLETE_H
|
||||
#define STATEVARCOMPLETE_H
|
||||
|
||||
@ -9,63 +8,21 @@
|
||||
*
|
||||
* \brief UpnpStateVarComplete object declararion.
|
||||
*
|
||||
* Represents the reply for the current value of a state variable in an
|
||||
* asynchronous call.
|
||||
*
|
||||
* \author Marcelo Roberto Jimenez
|
||||
*/
|
||||
|
||||
#define CLASS UpnpStateVarComplete
|
||||
|
||||
/*! Represents the reply for the current value of a state variable in an
|
||||
* asynchronous call. */
|
||||
typedef struct s_UpnpStateVarComplete UpnpStateVarComplete;
|
||||
#define EXPAND_CLASS_MEMBERS(CLASS) \
|
||||
EXPAND_CLASS_MEMBER_INT(CLASS, ErrCode, int) \
|
||||
EXPAND_CLASS_MEMBER_STRING(CLASS, CtrlUrl) \
|
||||
EXPAND_CLASS_MEMBER_STRING(CLASS, StateVarName) \
|
||||
EXPAND_CLASS_MEMBER_DOMSTRING(CLASS, CurrentVal) \
|
||||
|
||||
|
||||
#include "ixml.h" /* for DOMString */
|
||||
#include "UpnpGlobal.h" /* for EXPORT_SPEC */
|
||||
#include "UpnpString.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
/*! Constructor */
|
||||
EXPORT_SPEC UpnpStateVarComplete *UpnpStateVarComplete_new();
|
||||
|
||||
/*! Destructor */
|
||||
EXPORT_SPEC void UpnpStateVarComplete_delete(UpnpStateVarComplete *p);
|
||||
|
||||
/*! Copy Constructor */
|
||||
EXPORT_SPEC UpnpStateVarComplete *UpnpStateVarComplete_dup(const UpnpStateVarComplete *p);
|
||||
|
||||
/*! Assignment operator */
|
||||
EXPORT_SPEC void UpnpStateVarComplete_assign(UpnpStateVarComplete *p, const UpnpStateVarComplete *q);
|
||||
|
||||
/*! The result of the operation */
|
||||
EXPORT_SPEC int UpnpStateVarComplete_get_ErrCode(const UpnpStateVarComplete *p);
|
||||
EXPORT_SPEC void UpnpStateVarComplete_set_ErrCode(UpnpStateVarComplete *p, int n);
|
||||
|
||||
/*! The control URL for the service. */
|
||||
EXPORT_SPEC const UpnpString *UpnpStateVarComplete_get_CtrlUrl(const UpnpStateVarComplete *p);
|
||||
EXPORT_SPEC const char *UpnpStateVarComplete_get_CtrlUrl_cstr(const UpnpStateVarComplete *p);
|
||||
EXPORT_SPEC void UpnpStateVarComplete_set_CtrlUrl(UpnpStateVarComplete *p, const UpnpString *s);
|
||||
EXPORT_SPEC void UpnpStateVarComplete_strcpy_CtrlUrl(UpnpStateVarComplete *p, const char *s);
|
||||
|
||||
/*! The name of the variable. */
|
||||
EXPORT_SPEC const UpnpString *UpnpStateVarComplete_get_StateVarName(const UpnpStateVarComplete *p);
|
||||
EXPORT_SPEC const char *UpnpStateVarComplete_get_StateVarName_cstr(const UpnpStateVarComplete *p);
|
||||
EXPORT_SPEC void UpnpStateVarComplete_set_StateVarName(UpnpStateVarComplete *p, const UpnpString *s);
|
||||
EXPORT_SPEC void UpnpStateVarComplete_strcpy_StateVarName(UpnpStateVarComplete *p, const char *s);
|
||||
|
||||
/*! The current value of the variable. This needs to be allocated by
|
||||
* the caller. When finished with it, the SDK frees this \b DOMString. */
|
||||
EXPORT_SPEC const DOMString UpnpStateVarComplete_get_CurrentVal(const UpnpStateVarComplete *p);
|
||||
EXPORT_SPEC const char *UpnpStateVarComplete_get_CurrentVal_cstr(const UpnpStateVarComplete *p);
|
||||
EXPORT_SPEC void UpnpStateVarComplete_set_CurrentVal(UpnpStateVarComplete *p, const DOMString s);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#include "TemplateInclude.h"
|
||||
|
||||
|
||||
#endif /* STATEVARCOMPLETE_H */
|
||||
|
@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
/*!
|
||||
* \file
|
||||
*
|
||||
@ -8,163 +7,8 @@
|
||||
* \author Marcelo Roberto Jimenez
|
||||
*/
|
||||
|
||||
|
||||
#include "config.h"
|
||||
|
||||
|
||||
#define TEMPLATE_GENERATE_SOURCE
|
||||
#include "StateVarComplete.h"
|
||||
|
||||
|
||||
#include <stdlib.h> /* for calloc(), free() */
|
||||
#include <string.h> /* for strlen(), strdup() */
|
||||
|
||||
|
||||
struct SUpnpStateVarComplete
|
||||
{
|
||||
int m_errCode;
|
||||
UpnpString *m_ctrlUrl;
|
||||
UpnpString *m_stateVarName;
|
||||
DOMString m_currentVal;
|
||||
};
|
||||
|
||||
|
||||
UpnpStateVarComplete *UpnpStateVarComplete_new()
|
||||
{
|
||||
struct SUpnpStateVarComplete *p = calloc(1, sizeof (struct SUpnpStateVarComplete));
|
||||
|
||||
#if 0
|
||||
p->m_errCode = 0;
|
||||
#endif
|
||||
p->m_ctrlUrl = UpnpString_new();
|
||||
p->m_stateVarName = UpnpString_new();
|
||||
#if 0
|
||||
p->m_currentVal = NULL;
|
||||
#endif
|
||||
|
||||
return (UpnpStateVarComplete *)p;
|
||||
}
|
||||
|
||||
|
||||
void UpnpStateVarComplete_delete(UpnpStateVarComplete *p)
|
||||
{
|
||||
struct SUpnpStateVarComplete *q = (struct SUpnpStateVarComplete *)p;
|
||||
|
||||
if (!q) return;
|
||||
|
||||
q->m_errCode = 0;
|
||||
|
||||
UpnpString_delete(q->m_ctrlUrl);
|
||||
q->m_ctrlUrl = NULL;
|
||||
|
||||
UpnpString_delete(q->m_stateVarName);
|
||||
q->m_stateVarName = NULL;
|
||||
|
||||
ixmlFreeDOMString(q->m_currentVal);
|
||||
q->m_currentVal = NULL;
|
||||
|
||||
free(p);
|
||||
}
|
||||
|
||||
|
||||
UpnpStateVarComplete *UpnpStateVarComplete_dup(const UpnpStateVarComplete *p)
|
||||
{
|
||||
UpnpStateVarComplete *q = UpnpStateVarComplete_new();
|
||||
|
||||
UpnpStateVarComplete_assign(q, p);
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
|
||||
void UpnpStateVarComplete_assign(UpnpStateVarComplete *p, const UpnpStateVarComplete *q)
|
||||
{
|
||||
if (p != q) {
|
||||
UpnpStateVarComplete_set_ErrCode(p, UpnpStateVarComplete_get_ErrCode(q));
|
||||
UpnpStateVarComplete_set_CtrlUrl(p, UpnpStateVarComplete_get_CtrlUrl(q));
|
||||
UpnpStateVarComplete_set_StateVarName(p, UpnpStateVarComplete_get_StateVarName(q));
|
||||
UpnpStateVarComplete_set_CurrentVal(p, UpnpStateVarComplete_get_CurrentVal(q));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int UpnpStateVarComplete_get_ErrCode(const UpnpStateVarComplete *p)
|
||||
{
|
||||
return ((struct SUpnpStateVarComplete *)p)->m_errCode;
|
||||
}
|
||||
|
||||
|
||||
void UpnpStateVarComplete_set_ErrCode(UpnpStateVarComplete *p, int n)
|
||||
{
|
||||
((struct SUpnpStateVarComplete *)p)->m_errCode = n;
|
||||
}
|
||||
|
||||
|
||||
const UpnpString *UpnpStateVarComplete_get_CtrlUrl(const UpnpStateVarComplete *p)
|
||||
{
|
||||
return ((struct SUpnpStateVarComplete *)p)->m_ctrlUrl;
|
||||
}
|
||||
|
||||
const char *UpnpStateVarComplete_get_CtrlUrl_cstr(const UpnpStateVarComplete *p)
|
||||
{
|
||||
return UpnpString_get_String(UpnpStateVarComplete_get_CtrlUrl(p));
|
||||
}
|
||||
|
||||
|
||||
void UpnpStateVarComplete_set_CtrlUrl(UpnpStateVarComplete *p, const UpnpString *s)
|
||||
{
|
||||
UpnpString_delete(((struct SUpnpStateVarComplete *)p)->m_ctrlUrl);
|
||||
((struct SUpnpStateVarComplete *)p)->m_ctrlUrl = UpnpString_dup(s);
|
||||
}
|
||||
|
||||
|
||||
void UpnpStateVarComplete_strcpy_CtrlUrl(UpnpStateVarComplete *p, const char *s)
|
||||
{
|
||||
UpnpString_delete(((struct SUpnpStateVarComplete *)p)->m_ctrlUrl);
|
||||
((struct SUpnpStateVarComplete *)p)->m_ctrlUrl = UpnpString_new();
|
||||
UpnpString_set_String(((struct SUpnpStateVarComplete *)p)->m_ctrlUrl, s);
|
||||
}
|
||||
|
||||
|
||||
const UpnpString *UpnpStateVarComplete_get_StateVarName(const UpnpStateVarComplete *p)
|
||||
{
|
||||
return ((struct SUpnpStateVarComplete *)p)->m_stateVarName;
|
||||
}
|
||||
|
||||
const char *UpnpStateVarComplete_get_StateVarName_cstr(const UpnpStateVarComplete *p)
|
||||
{
|
||||
return UpnpString_get_String(UpnpStateVarComplete_get_StateVarName(p));
|
||||
}
|
||||
|
||||
|
||||
void UpnpStateVarComplete_set_StateVarName(UpnpStateVarComplete *p, const UpnpString *s)
|
||||
{
|
||||
UpnpString_delete(((struct SUpnpStateVarComplete *)p)->m_stateVarName);
|
||||
((struct SUpnpStateVarComplete *)p)->m_stateVarName = UpnpString_dup(s);
|
||||
}
|
||||
|
||||
|
||||
void UpnpStateVarComplete_strcpy_StateVarName(UpnpStateVarComplete *p, const char *s)
|
||||
{
|
||||
UpnpString_delete(((struct SUpnpStateVarComplete *)p)->m_ctrlUrl);
|
||||
((struct SUpnpStateVarComplete *)p)->m_ctrlUrl = UpnpString_new();
|
||||
UpnpString_set_String(((struct SUpnpStateVarComplete *)p)->m_ctrlUrl, s);
|
||||
}
|
||||
|
||||
|
||||
const DOMString UpnpStateVarComplete_get_CurrentVal(const UpnpStateVarComplete *p)
|
||||
{
|
||||
return ((struct SUpnpStateVarComplete *)p)->m_currentVal;
|
||||
}
|
||||
|
||||
const char *UpnpStateVarComplete_get_CurrentVal_cstr(const UpnpStateVarComplete *p)
|
||||
{
|
||||
return (const char *)UpnpStateVarComplete_get_CurrentVal(p);
|
||||
}
|
||||
|
||||
|
||||
void UpnpStateVarComplete_set_CurrentVal(UpnpStateVarComplete *p, const DOMString s)
|
||||
{
|
||||
ixmlFreeDOMString(((struct SUpnpStateVarComplete *)p)->m_currentVal);
|
||||
((struct SUpnpStateVarComplete *)p)->m_currentVal = ixmlCloneDOMString(s);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user