39 #ifndef _PLT_PROTOCOL_INFO_H_
40 #define _PLT_PROTOCOL_INFO_H_
56 typedef struct PLT_HttpFileRequestHandler_DefaultDlnaExtMapEntry {
57 const char* mime_type;
59 } PLT_HttpFileRequestHandler_DefaultDlnaExtMapEntry ;
73 FieldEntry(
const char* key,
const char* value) :
74 m_Key(key), m_Value(value) {}
80 static NPT_String GetMimeTypeFromProtocolInfo(
const char* protocol_info);
82 static const char* GetDlnaExtension(
const char* mime_type,
84 static const char* GetDlnaExtension(
const char* mime_type,
85 PLT_DeviceSignature signature = PLT_DEVICE_UNKNOWN);
88 bool with_dlna_extension =
true,
91 bool with_dlna_extension =
true,
92 PLT_DeviceSignature signature = PLT_DEVICE_UNKNOWN);
95 bool with_dlna_extension =
true,
98 bool with_dlna_extension =
true,
99 PLT_DeviceSignature signature = PLT_DEVICE_UNKNOWN);
107 const char* content_type,
109 const NPT_String& GetProtocol()
const {
return m_Protocol; }
110 const NPT_String& GetMask()
const {
return m_Mask; }
111 const NPT_String& GetContentType()
const {
return m_ContentType; }
112 const NPT_String& GetExtra()
const {
return m_Extra; }
114 const NPT_String& GetDLNA_PN()
const {
return m_DLNA_PN; }
116 bool IsValid() {
return m_Valid; }
118 NPT_String ToString()
const;
124 PLT_PROTINFO_PARSER_STATE_START,
125 PLT_PROTINFO_PARSER_STATE_PN,
126 PLT_PROTINFO_PARSER_STATE_OP,
127 PLT_PROTINFO_PARSER_STATE_PS,
128 PLT_PROTINFO_PARSER_STATE_CI,
129 PLT_PROTINFO_PARSER_STATE_FLAGS,
130 PLT_PROTINFO_PARSER_STATE_MAXSP,
131 PLT_PROTINFO_PARSER_STATE_OTHER
132 } PLT_ProtocolInfoParserState;
134 NPT_Result SetProtocolInfo(
const char* protocol_info);
135 NPT_Result ValidateField(
const char* val,
136 const char* valid_chars,
137 NPT_Cardinal num_chars = 0);
138 NPT_Result ParseExtra(NPT_List<FieldEntry>& entries);
139 NPT_Result ValidateExtra();
142 NPT_String m_Protocol;
144 NPT_String m_ContentType;
147 NPT_String m_DLNA_PN;
148 NPT_String m_DLNA_OP;
149 NPT_String m_DLNA_PS;
150 NPT_String m_DLNA_CI;
151 NPT_String m_DLNA_FLAGS;
152 NPT_String m_DLNA_MAXSP;
153 NPT_List<FieldEntry> m_DLNA_OTHER;
The PLT_ProtocolInfo class holds information about the protocol info of a given UPnP Media Item resou...
Definition: PltProtocolInfo.h:68
The PLT_HttpRequestContext class holds information about the request sent, the local & remote ip addr...
Definition: PltHttp.h:115