From 4d94cd68ade3d2f1f39a3e64dafa2a5568eac7a1 Mon Sep 17 00:00:00 2001 From: Gerald Begumisa Date: Thu, 16 Jul 2009 16:31:03 +0000 Subject: Switched from custom Trim() function to CStdString Trim() git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@626 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkaudio/audiocaptureplugins/voip/VoIp.cpp | 49 +++++------------------------- 1 file changed, 8 insertions(+), 41 deletions(-) (limited to 'orkaudio/audiocaptureplugins/voip/VoIp.cpp') diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.cpp b/orkaudio/audiocaptureplugins/voip/VoIp.cpp index 3045501..909b3d1 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIp.cpp +++ b/orkaudio/audiocaptureplugins/voip/VoIp.cpp @@ -97,7 +97,6 @@ public: CStdString GetPcapDeviceName(pcap_t* pcapHandle); void ProcessLocalPartyMap(char *line, int ln); void LoadPartyMaps(); - void TrimCString(char **s); private: void OpenDevices(); @@ -3293,43 +3292,6 @@ void VoIp::OpenDevices() } } -void VoIp::TrimCString(char **s) -{ - char *x = NULL; - char *y = NULL; - - if(*s == NULL || !strlen(*s)) - { - *s = ""; - return; - } - - x = *s; - y = *s+strlen(*s); - - while(x < y && isblank(*x)) - { - x += 1; - } - - if(!strlen(x)) - { - *s = x; - return; - } - - y -= 1; - while(y >= x && isblank(*y)) - { - *y = '\0'; - y -= 1; - } - - *s = x; - return; - -} - void VoIp::ProcessLocalPartyMap(char *line, int ln) { char *oldparty = NULL; @@ -3349,10 +3311,15 @@ void VoIp::ProcessLocalPartyMap(char *line, int ln) *(newparty++) = '\0'; - TrimCString(&oldparty); - TrimCString(&newparty); + CStdString oldpty, newpty; + + oldpty = oldparty; + newpty = newparty; + + oldpty.Trim(); + newpty.Trim(); - RtpSessionsSingleton::instance()->SaveLocalPartyMap(oldparty, newparty); + RtpSessionsSingleton::instance()->SaveLocalPartyMap(oldpty, newpty); } void VoIp::LoadPartyMaps() -- cgit v1.2.3