Switch to unified view

a/libupnpp/control/cdirectory.hxx b/libupnpp/control/cdirectory.hxx
...
...
17
#ifndef _UPNPDIR_HXX_INCLUDED_
17
#ifndef _UPNPDIR_HXX_INCLUDED_
18
#define _UPNPDIR_HXX_INCLUDED_
18
#define _UPNPDIR_HXX_INCLUDED_
19
19
20
#include <string>
20
#include <string>
21
#include <set>
21
#include <set>
22
#include <memory>
22
23
23
#include "libupnpp/description.hxx"
24
#include "libupnpp/description.hxx"
24
#include "libupnpp/control/service.hxx"
25
#include "libupnpp/control/service.hxx"
25
#include "libupnpp/control/cdircontent.hxx"
26
#include "libupnpp/control/cdircontent.hxx"
26
27
27
namespace UPnPClient {
28
namespace UPnPClient {
29
30
class ContentDirectoryService;
31
typedef std::shared_ptr<ContentDirectoryService> CDSH;
28
32
29
/**
33
/**
30
 * Content Directory Service client class.
34
 * Content Directory Service client class.
31
 *
35
 *
32
 * This stores identity data from a directory service
36
 * This stores identity data from a directory service
...
...
54
            if (!m_modelName.compare("MediaTomb")) {
58
            if (!m_modelName.compare("MediaTomb")) {
55
                // Readdir by 200 entries is good for most, but MediaTomb likes
59
                // Readdir by 200 entries is good for most, but MediaTomb likes
56
                // them really big. Actually 1000 is better but I don't dare
60
                // them really big. Actually 1000 is better but I don't dare
57
                m_rdreqcnt = 500;
61
                m_rdreqcnt = 500;
58
            }
62
            }
63
            registerCallback();
59
        }
64
        }
60
65
61
    /** An empty one */
66
    /** An empty one */
62
    ContentDirectoryService() {}
67
    ContentDirectoryService() {}
63
68
64
    /** Test service type from discovery message */
69
    /** Test service type from discovery message */
65
    static bool isCDService(const std::string& st);
70
    static bool isCDService(const std::string& st);
66
71
67
    /** Retrieve the directory services currently seen on the network */
72
    /** Retrieve the directory services currently seen on the network */
68
    static bool getServices(std::vector<ContentDirectoryService>&);
73
    static bool getServices(std::vector<CDSH>&);
69
74
70
    /** Retrieve specific service designated by its friendlyName */
75
    /** Retrieve specific service designated by its friendlyName */
71
    static bool getServerByName(const std::string& friendlyName, 
76
    static bool getServerByName(const std::string& friendlyName, 
72
                                ContentDirectoryService& server);
77
                                CDSH& server);
73
78
74
    /** Read a full container's children list 
79
    /** Read a full container's children list 
75
     *
80
     *
76
     * @param objectId the UPnP object Id for the container. Root has Id "0"
81
     * @param objectId the UPnP object Id for the container. Root has Id "0"
77
     * @param[out] dirbuf stores the entries we read.
82
     * @param[out] dirbuf stores the entries we read.
...
...
135
    // The service type string for Content Directories:
140
    // The service type string for Content Directories:
136
    static const std::string SType;
141
    static const std::string SType;
137
142
138
private:
143
private:
139
    int m_rdreqcnt; // Slice size to use when reading
144
    int m_rdreqcnt; // Slice size to use when reading
145
    void evtCallback(const std::unordered_map<std::string, std::string>&);
146
    void registerCallback();
140
};
147
};
141
148
142
}
149
}
143
150
144
#endif /* _UPNPDIR_HXX_INCLUDED_ */
151
#endif /* _UPNPDIR_HXX_INCLUDED_ */