⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pxmlrpc.h

📁 安装 H323需要的pwlib库
💻 H
📖 第 1 页 / 共 2 页
字号:
    virtual void FromString(PINDEX i, const PString & str);    virtual PXMLRPCStructBase * GetStruct(PINDEX i) const;    virtual BOOL IsArray() const;    virtual PINDEX GetSize() const;    virtual BOOL SetSize(PINDEX);    PString ToBase64(PAbstractArray & data) const;    void FromBase64(const PString & str, PAbstractArray & data);  protected:    const char * name;    const char * type;  private:    PXMLRPCVariableBase(const PXMLRPCVariableBase &) { }};class PXMLRPCArrayBase : public PXMLRPCVariableBase {    PCLASSINFO(PXMLRPCArrayBase, PXMLRPCVariableBase);  protected:    PXMLRPCArrayBase(PContainer & array, const char * name, const char * type);    PXMLRPCArrayBase & operator=(const PXMLRPCArrayBase &);  public:    virtual void PrintOn(ostream & strm) const;    virtual void Copy(const PXMLRPCVariableBase & other);    virtual BOOL IsArray() const;    virtual PINDEX GetSize() const;    virtual BOOL SetSize(PINDEX);  protected:    PContainer & array;};class PXMLRPCArrayObjectsBase : public PXMLRPCArrayBase {    PCLASSINFO(PXMLRPCArrayObjectsBase, PXMLRPCArrayBase);  protected:    PXMLRPCArrayObjectsBase(PArrayObjects & array, const char * name, const char * type);    PXMLRPCArrayObjectsBase & operator=(const PXMLRPCArrayObjectsBase &);  public:    virtual PString ToString(PINDEX i) const;    virtual void FromString(PINDEX i, const PString & str);    virtual BOOL SetSize(PINDEX);    virtual PObject * CreateObject() const = 0;  protected:    PArrayObjects & array;};class PXMLRPCStructBase : public PObject {    PCLASSINFO(PXMLRPCStructBase, PObject);  protected:    PXMLRPCStructBase();    PXMLRPCStructBase & operator=(const PXMLRPCStructBase &);  private:    PXMLRPCStructBase(const PXMLRPCStructBase &) { }  public:    void PrintOn(ostream & strm) const;    PINDEX GetNumVariables() const { return variablesByOrder.GetSize(); }    PXMLRPCVariableBase & GetVariable(PINDEX idx) const { return variablesByOrder[idx]; }    PXMLRPCVariableBase * GetVariable(const char * name) const { return variablesByName.GetAt(name); }    void AddVariable(PXMLRPCVariableBase * var);    static PXMLRPCStructBase & GetInitialiser() { return *PAssertNULL(initialiserInstance); }  protected:    void EndConstructor();    PList<PXMLRPCVariableBase>                variablesByOrder;    PDictionary<PString, PXMLRPCVariableBase> variablesByName;    PXMLRPCStructBase        * initialiserStack;    static PMutex              initialiserMutex;    static PXMLRPCStructBase * initialiserInstance;};#define PXMLRPC_STRUCT_BEGIN(name) \  class name : public PXMLRPCStructBase { \    public: name() { EndConstructor(); } \    public: name(const name & other) { EndConstructor(); operator=(other); } \    public: name & operator=(const name & other) { PXMLRPCStructBase::operator=(other); return *this; }#define PXMLRPC_VARIABLE_CLASS(base, type, variable, xmltype, init, extras) \    private: struct PXMLRPCVar_##variable : public PXMLRPCVariableBase { \      PXMLRPCVar_##variable() \        : PXMLRPCVariableBase(#variable, xmltype), \          instance(((base &)base::GetInitialiser()).variable) \        { init } \      virtual void PrintOn (ostream & s) const { s << instance; } \      virtual void ReadFrom(istream & s)       { s >> instance; } \      virtual void Copy(const PXMLRPCVariableBase & other) \                    { instance = ((PXMLRPCVar_##variable &)other).instance; } \      extras \      type & instance; \    } pxmlrpcvar_##variable#define PXMLRPC_VARIABLE_CUSTOM(base, type, variable, xmltype, init, extras) \    public: type variable; \    PXMLRPC_VARIABLE_CLASS(base, type, variable, xmltype, init, extras)#define PXMLRPC_ARRAY_CUSTOM(base, arraytype, basetype, variable, xmltype, par, extras) \    public: arraytype variable; \    private: struct PXMLRPCVar_##variable : public par { \      PXMLRPCVar_##variable() \        : par(((base &)base::GetInitialiser()).variable, #variable, xmltype), \          instance((arraytype &)array) \        { } \      extras \      arraytype & instance; \    } pxmlrpcvar_##variable#ifdef DOCPLUSPLUS}#endif#define PXMLRPC_STRUCT_END() \  };#define PXMLRPC_VARIABLE(base, type, variable, xmltype) \        PXMLRPC_VARIABLE_CUSTOM(base, type, variable, xmltype, ;, ;)#define PXMLRPC_VARIABLE_INIT(base, type, variable, xmltype, init) \        PXMLRPC_VARIABLE_CUSTOM(base, type, variable, xmltype, instance=init;, ;)#define PXMLRPC_STRING(base, type, variable) \        PXMLRPC_VARIABLE(base, type, variable, "string")#define PXMLRPC_STRING_INIT(base, type, variable, init) \        PXMLRPC_VARIABLE_INIT(base, type, variable, "string", init)#define PXMLRPC_INTEGER(base, type, variable) \        PXMLRPC_VARIABLE(base, type, variable, "int")#define PXMLRPC_INTEGER_INIT(base, type, variable, init) \        PXMLRPC_VARIABLE_INIT(base, type, variable, "int", init)#define PXMLRPC_BOOLEAN(base, type, variable) \        PXMLRPC_VARIABLE(base, type, variable, "boolean")#define PXMLRPC_BOOLEAN_INIT(base, type, variable, init) \        PXMLRPC_VARIABLE_INIT(base, type, variable, "boolean", init)#define PXMLRPC_DOUBLE(base, type, variable) \        PXMLRPC_VARIABLE(base, type, variable, "double")#define PXMLRPC_DOUBLE_INIT(base, type, variable, init) \        PXMLRPC_VARIABLE_INIT(base, type, variable, "double", init)#define PXMLRPC_DATETIME(base, type, variable) \        PXMLRPC_VARIABLE_CUSTOM(base, type, variable, "dateTime.iso8601", ;, \                    PString ToString(PINDEX) const { return instance.AsString(PTime::ShortISO8601); } )#define PXMLRPC_BINARY(base, type, variable) \        PXMLRPC_VARIABLE_CUSTOM(base, type, variable, "base64", ;, \                    PString ToString(PINDEX) const { return ToBase64(instance); } \                    void FromString(PINDEX, const PString & str) { FromBase64(str, instance); } )#define PXMLRPC_STRUCT(base, type, variable) \        PXMLRPC_VARIABLE_CUSTOM(base, type, variable, "struct", ;, \                    PXMLRPCStructBase * GetStruct(PINDEX) const { return &instance; } )#define PXMLRPC_ARRAY(base, arraytype, basetype, variable, xmltype) \        PXMLRPC_ARRAY_CUSTOM(base, arraytype, basetype, variable, xmltype, PXMLRPCArrayObjectsBase, \                    PObject * CreateObject() const { return new basetype; })#define PXMLRPC_ARRAY_STRING(base, arraytype, basetype, variable) \        PXMLRPC_ARRAY(base, arraytype, basetype, variable, "string")#define PXMLRPC_ARRAY_INTEGER(base, type, variable) \        PXMLRPC_ARRAY_CUSTOM(base, PScalarArray<type>, type, variable, "int", PXMLRPCArrayBase, \                    PString ToString(PINDEX i) const { return PString(instance[i]); } \                    void FromString(PINDEX i, const PString & str) { instance[i] = (type)str.AsInteger(); })#define PXMLRPC_ARRAY_DOUBLE(base, type, variable) \        PXMLRPC_ARRAY_CUSTOM(base, PScalarArray<type>, type, variable, "double", PXMLRPCArrayBase, \                    PString ToString(PINDEX i) const { return psprintf("%f", instance[i]); } \                    void FromString(PINDEX i, const PString & str) { instance[i] = (type)str.AsReal(); })#define PXMLRPC_ARRAY_STRUCT(base, type, variable) \        PXMLRPC_ARRAY_CUSTOM(base, PArray<type>, type, variable, "struct", PXMLRPCArrayObjectsBase, \                             PXMLRPCStructBase * GetStruct(PINDEX i) const { return &instance[i]; } \                             PObject * CreateObject() const { return new type; })#define PXMLRPC_FUNC_NOARG_NOREPLY(name) \  BOOL name() { return MakeRequest(#name); }#define PXMLRPC_FUNC_SINGLE_ARG(name, vartype, argtype) \  class name##_in : public PXMLRPCStructBase { \    public: name##_in(const argtype & var) : variable(var) { EndConstructor(); } \        vartype(name##_in, argtype, variable);#define PXMLRPC_FUNC_MULTI_ARGS(name) \  PXMLRPC_STRUCT_BEGIN(name##_in)#ifdef DOCPLUSPLUS{#endif#define PXMLRPC_FUNC_MULTI_REPLY(name) \  }; PXMLRPC_STRUCT_BEGIN(name##_out)#ifdef DOCPLUSPLUS{#endif#define PXMLRPC_FUNC_NO_ARGS(name) \  }; \  BOOL name(name##_out & reply) \    { return MakeRequest(#name, name##_in(), reply); }#ifdef DOCPLUSPLUS{#endif#define PXMLRPC_FUNC_STRUCT_ARG(name) \  }; \  class name##_in_carrier : public PXMLRPCStructBase { \    public: name##_in_carrier(const name##_in & var) : variable(var) { EndConstructor(); } \    private: struct var_class : public PXMLRPCVariableBase { \      var_class(const name##_in & var) \        : PXMLRPCVariableBase("variable", "struct"), instance(var) { } \      virtual void PrintOn (ostream & s) const { s << instance; } \      virtual PXMLRPCStructBase * GetStruct(PINDEX) const { return (PXMLRPCStructBase *)&instance; } \      virtual void Copy(const PXMLRPCVariableBase &) { } \      const name##_in & instance; \    } variable; \  }; \  BOOL name(const name##_in & args, name##_out & reply) \    { return MakeRequest(#name, name##_in_carrier(args), reply); }#ifdef DOCPLUSPLUS{#endif#define PXMLRPC_FUNC_NORM_ARGS(name) \  }; \  BOOL name(const name##_in & args, name##_out & reply) \    { return MakeRequest(#name, args, reply); }/////////////////////////////////////////////////////////////////#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -