From e91525e96ee19654cb7f5483e48d89a992628b6c Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Fri, 5 May 2017 18:04:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=8D=E5=8C=BA=E5=88=86?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E5=86=99=E7=9A=84map?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtsp/Rtsp.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Rtsp/Rtsp.h b/src/Rtsp/Rtsp.h index 494b597e..3d71d0f5 100644 --- a/src/Rtsp/Rtsp.h +++ b/src/Rtsp/Rtsp.h @@ -6,8 +6,10 @@ #include #include #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 StrCaseMap; + class Parser { public: Parser() { @@ -125,7 +135,7 @@ public: this->m_strContent = content; } - const map& getValues() const { + const StrCaseMap& getValues() const { return m_mapValues; } @@ -135,7 +145,7 @@ private: string m_strTail; string m_strContent; string m_strNull; - map m_mapValues; + StrCaseMap m_mapValues; };