Author: sayer
Date: 2009-03-04 16:25:02 +0100 (Wed, 04 Mar 2009)
New Revision: 1297
Modified:
trunk/core/AmUriParser.cpp
trunk/core/AmUriParser.h
Log:
made UriParser param const
Modified: trunk/core/AmUriParser.cpp
===================================================================
--- trunk/core/AmUriParser.cpp 2009-03-03 21:05:13 UTC (rev 1296)
+++ trunk/core/AmUriParser.cpp 2009-03-04 15:25:02 UTC (rev 1297)
@@ -46,7 +46,7 @@
/*
* Skip display name part
*/
-static inline int skip_name(string& s, unsigned int pos)
+static inline int skip_name(const string& s, unsigned int pos)
{
size_t i;
int last_wsp, quoted = 0;
@@ -89,7 +89,7 @@
* Skip URI, stops when , (next contact)
* or ; (parameter) is found
*/
-static inline int skip_uri(string& s, unsigned int pos)
+static inline int skip_uri(const string& s, unsigned int pos)
{
unsigned int len = s.length() - pos;
unsigned int p = pos;
@@ -310,7 +310,7 @@
* parse params int param map
*
*/
-bool AmUriParser::parse_params(string& line, int& pos) {
+bool AmUriParser::parse_params(const string& line, int& pos) {
size_t p1=pos, p2=pos;
int st = 0; int quoted = false;
char last_c = ' ';
@@ -357,7 +357,7 @@
}
-bool AmUriParser::parse_contact(string& line, size_t pos, size_t& end) {
+bool AmUriParser::parse_contact(const string& line, size_t pos, size_t& end) {
int p0 = skip_name(line, pos);
if (p0 < 0) { return false; }
int p1 = skip_uri(line, p0);
Modified: trunk/core/AmUriParser.h
===================================================================
--- trunk/core/AmUriParser.h 2009-03-03 21:05:13 UTC (rev 1296)
+++ trunk/core/AmUriParser.h 2009-03-04 15:25:02 UTC (rev 1297)
@@ -42,9 +42,9 @@
map<string, string> params;
bool isEqual(const AmUriParser& c) const;
- bool parse_contact(string& line, size_t pos, size_t& end);
+ bool parse_contact(const string& line, size_t pos, size_t& end);
bool parse_uri();
- bool parse_params(string& line, int& pos);
+ bool parse_params(const string& line, int& pos);
void dump();
AmUriParser() { }
};
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev