OpenVPN 3 Core Library
Loading...
Searching...
No Matches
cf.hpp File Reference
#include <string>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <utility>
#include <exception>
#include <CoreFoundation/CoreFoundation.h>
Include dependency graph for cf.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  openvpn::CF::Type< T >
 
class  openvpn::CF::Wrap< T >
 
struct  openvpn::CF::cppstring_error
 

Namespaces

namespace  openvpn
 
namespace  openvpn::CF
 

Macros

#define OPENVPN_CF_WRAP(cls, castmeth, cftype, idmeth)
 

Typedefs

typedef Wrap< CFTypeRef > openvpn::CF::Generic
 

Enumerations

enum  openvpn::CF::Rule { openvpn::CF::CREATE , openvpn::CF::GET }
 

Functions

 openvpn::CF::OPENVPN_CF_WRAP (Error, error_cast, CFErrorRef, CFErrorGetTypeID)
 
Generic openvpn::CF::generic_cast (CFTypeRef obj)
 
String openvpn::CF::string (const char *str)
 
String openvpn::CF::string (CFStringRef str)
 
String openvpn::CF::string (const String &str)
 
String openvpn::CF::string (const std::string &str)
 
String openvpn::CF::string (const std::string *str)
 
Number openvpn::CF::number_from_int (const int n)
 
Number openvpn::CF::number_from_int32 (const SInt32 n)
 
Number openvpn::CF::number_from_long_long (const long long n)
 
Number openvpn::CF::number_from_index (const CFIndex n)
 
Data openvpn::CF::data (const void *bytes, CFIndex length)
 
Array openvpn::CF::array (const void **values, CFIndex numValues)
 
Dict openvpn::CF::dict (const void **keys, const void **values, CFIndex numValues)
 
Dict openvpn::CF::const_dict (MutableDict &mdict)
 
Array openvpn::CF::const_array (MutableArray &marray)
 
Dict openvpn::CF::empty_dict ()
 
MutableArray openvpn::CF::mutable_array (const CFIndex capacity=0)
 
MutableDict openvpn::CF::mutable_dict (const CFIndex capacity=0)
 
template<typename DICT >
MutableDict openvpn::CF::mutable_dict_copy (const DICT &dict, const CFIndex capacity=0)
 
Error openvpn::CF::error (CFStringRef domain, CFIndex code, CFDictionaryRef userInfo)
 
template<typename ARRAY >
CFIndex openvpn::CF::array_len (const ARRAY &array)
 
template<typename DICT >
CFIndex openvpn::CF::dict_len (const DICT &dict)
 
template<typename ARRAY >
CFTypeRef openvpn::CF::array_index (const ARRAY &array, const CFIndex idx)
 
template<typename DICT , typename KEY >
CFTypeRef openvpn::CF::dict_index (const DICT &dict, const KEY &key)
 
std::string openvpn::CF::cppstring (CFStringRef str)
 
std::string openvpn::CF::cppstring (const String &str)
 
std::string openvpn::CF::description (CFTypeRef obj)
 
template<typename ARRAY >
std::string openvpn::CF::array_to_string (const ARRAY &array, const char delim=',')
 
bool openvpn::CF::string_equal (const String &s1, const String &s2, const CFStringCompareFlags compareOptions=0)
 
Data openvpn::CF::plist (CFTypeRef obj)
 

Macro Definition Documentation

◆ OPENVPN_CF_WRAP

#define OPENVPN_CF_WRAP (   cls,
  castmeth,
  cftype,
  idmeth 
)
Value:
template <> \
struct Type<cftype> \
{ \
static CFTypeRef cast(CFTypeRef obj) \
{ \
if (obj && CFGetTypeID(obj) == idmeth()) \
return obj; \
else \
return nullptr; \
} \
}; \
typedef Wrap<cftype> cls; \
inline cls castmeth(CFTypeRef obj) \
{ \
CFTypeRef o = Type<cftype>::cast(obj); \
if (o) \
return cls(cftype(o), GET); \
else \
return cls(); \
}

Definition at line 26 of file cf.hpp.