DeviceAtlas C++ Api documentation
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
Mobi::Mtld::Da::DeviceAtlas Class Reference
Inheritance diagram for Mobi::Mtld::Da::DeviceAtlas:
Mobi::Mtld::Da::CommonDeviceAtlas

Public Types

enum  { NoREFold = 1 << 0, Debug = 1 << 1, OverwriteUnconflicted = 1 << 2 }
 

Public Member Functions

const PropertygetpropId () const
 
const PropertygetpropOname () const
 
const PropertygetpropOversion () const
 
const PropertygetpropOversionNm () const
 
const PropertygetpropIsbw () const
 
void doReplacements (const std::vector< size_t > *, char *, size_t) const
 
void setConfig (DaConfig &_dcfg)
 
bool hasUAProps () const
 
bool hasLangProps () const
 
bool hasMatchedProps () const
 
const std::shared_ptr< UARgetUAR () const
 
const std::shared_ptr< CPRgetCPR () const
 
 DeviceAtlas (DaConfig &_dcfg)
 
 DeviceAtlas (std::istream &, const char *treeFields[]=getTreeUA(), unsigned long flags=0)
 Constructor, adds minimum _matched, _unmatched properties. More...
 
void loadDataFromFile (const char *, const char *treeFields[]=getTreeUA(), unsigned long flags=0)
 Loads the json from file path. More...
 
void loadDataFromStream (std::istream &, const char *treeFields[]=getTreeUA(), unsigned long flags=0)
 Loads the json from file stream. More...
 
const ValuegetValue (size_t) const
 
const std::string & getResetWalkString (size_t) const
 
int getTreeRevision () const
 Returns creation date. More...
 
time_t getTreeGeneration () const
 
int getDataRevision () const
 
time_t getDataGeneration () const
 
- Public Member Functions inherited from Mobi::Mtld::Da::CommonDeviceAtlas
const PropertyaddProperty (const char *name, PropertyType type)
 
const PropertyfindPropertyDescr (const char *p) const
 
const PropertygetPropertyDescr (const char *p) const
 
const PropertygetPropertyDescr (size_t off) const
 
size_t getPropertyCount () const
 
const propvec & getPropertyNames () const
 Returns the Json's properties list. More...
 
 __attribute__ ((malloc)) char *strdup(const char *)
 
 __attribute__ ((malloc)) char *strdup(const char *
 

Static Public Member Functions

static const char ** getTreeUA ()
 
static const char ** getTreeAll ()
 

Public Attributes

Noderoots [TREEID_MAX]
 
unsigned long flags
 
unsigned maxDepth
 
struct {
   size_t   _user_agent_matched
 
   size_t   _user_agent_unmatched
 
   size_t   _language_locale
 
   size_t   _language
 
synthetic
 These are property indexes of artificial properties, added after the JSON is parsed.
 
- Public Attributes inherited from Mobi::Mtld::Da::CommonDeviceAtlas
 size_t
 

Static Public Attributes

static const char * treeUA [] = { "t", 0 }
 When constructing the atlas, this null-terminated list of strings is used to indicate the field names used to encode each tree. treeUA is the value { "t", 0 }, while treeAll is { "t", "u", 0 }. treeUA is the current default: future evidence trees can be added without recourse to updating the API.
 
static const char * treeAll [] = { "t", "u", 0 }
 

Friends

class DAParse
 
class NodeParse
 
class ReplacementStringParser
 
class RuleGroup
 
struct CPRParser
 
struct RGParser
 
struct UARParser
 
struct AttrVecParser
 
struct CPRulesParser
 
struct UAStockParser
 
struct ResetWalkParser
 
struct DataParse
 
struct ValueParse
 

Constructor & Destructor Documentation

◆ DeviceAtlas()

Mobi::Mtld::Da::DeviceAtlas::DeviceAtlas ( std::istream &  ,
const char *  treeFields[] = getTreeUA(),
unsigned long  flags = 0 
)

Constructor, adds minimum _matched, _unmatched properties.

Deprecated:
Parameters
fgeneric input stream
treeFields
flags

Member Function Documentation

◆ getTreeRevision()

int Mobi::Mtld::Da::DeviceAtlas::getTreeRevision ( ) const

Returns creation date.

Returns
Date

◆ loadDataFromFile()

void Mobi::Mtld::Da::DeviceAtlas::loadDataFromFile ( const char *  jsonpath,
const char *  treeFields[] = getTreeUA(),
unsigned long  flags = 0 
)

Loads the json from file path.

Parameters
jsonpathpath of json file

◆ loadDataFromStream()

void Mobi::Mtld::Da::DeviceAtlas::loadDataFromStream ( std::istream &  ,
const char *  treeFields[] = getTreeUA(),
unsigned long  flags = 0 
)

Loads the json from file stream.

Parameters
stream

The documentation for this class was generated from the following files: