diff --git a/trunk/src/core/srs_core.cpp b/trunk/src/core/srs_core.cpp index 96db00bc9..8f409f4ec 100644 --- a/trunk/src/core/srs_core.cpp +++ b/trunk/src/core/srs_core.cpp @@ -37,17 +37,21 @@ _SrsContextId::_SrsContextId(const _SrsContextId& cp) v_ = cp.v_; } -const char* _SrsContextId::c_str() +_SrsContextId::~_SrsContextId() +{ +} + +const char* _SrsContextId::c_str() const { return v_.c_str(); } -bool _SrsContextId::empty() +bool _SrsContextId::empty() const { return v_.empty(); } -int _SrsContextId::compare(const _SrsContextId& to) +int _SrsContextId::compare(const _SrsContextId& to) const { return v_.compare(to.v_); } diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 65da94cd0..a68549697 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -125,14 +125,15 @@ public: _SrsContextId(); _SrsContextId(std::string v); _SrsContextId(const _SrsContextId& cp); + virtual ~_SrsContextId(); public: - const char* c_str(); - bool empty(); + const char* c_str() const; + bool empty() const; // Compare the two context id. @see http://www.cplusplus.com/reference/string/string/compare/ // 0 They compare equal // <0 Either the value of the first character that does not match is lower in the compared string, or all compared characters match but the compared string is shorter. // >0 Either the value of the first character that does not match is greater in the compared string, or all compared characters match but the compared string is longer. - int compare(const _SrsContextId& to); + int compare(const _SrsContextId& to) const; }; typedef _SrsContextId SrsContextId; #else