添加不区分大小写的map

This commit is contained in:
xiongziliang 2017-05-05 18:04:23 +08:00
parent 6a411da024
commit e91525e96e

View File

@ -6,8 +6,10 @@
#include <memory>
#include <unordered_map>
#include "Common/config.h"
#include "Util/util.h"
using namespace std;
using namespace ZL::Util;
typedef enum {
TrackVideo = 0, TrackAudio
@ -51,6 +53,14 @@ public:
string FindField(const char* buf, const char* start, const char *end,int bufSize = 0 );
int parserSDP(const string& sdp, RtspTrack Track[2]);
struct StrCaseCompare
{
bool operator()(const string& __x, const string& __y) const
{return strcasecmp(__x.data(), __y.data()) < 0 ;}
};
typedef map<string,string,StrCaseCompare> StrCaseMap;
class Parser {
public:
Parser() {
@ -125,7 +135,7 @@ public:
this->m_strContent = content;
}
const map<string, string>& getValues() const {
const StrCaseMap& getValues() const {
return m_mapValues;
}
@ -135,7 +145,7 @@ private:
string m_strTail;
string m_strContent;
string m_strNull;
map<string, string> m_mapValues;
StrCaseMap m_mapValues;
};