Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert partly cppcheck: fix passedByValue (part 1) #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions inc/libcmis/xml-utils.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ namespace libcmis
*/
LIBCMIS_API void registerSoapNamespaces( xmlXPathContextPtr xpathCtx );

LIBCMIS_API std::string getXPathValue( xmlXPathContextPtr xpathCtx, const std::string& req );
LIBCMIS_API std::string getXPathValue( xmlXPathContextPtr xpathCtx, std::string req );

LIBCMIS_API xmlDocPtr wrapInDoc( xmlNodePtr entryNode );

Expand All @@ -138,16 +138,16 @@ namespace libcmis

/** Parse a xsd:dateTime string and return the corresponding UTC posix time.
*/
LIBCMIS_API boost::posix_time::ptime parseDateTime( const std::string& dateTimeStr );
LIBCMIS_API boost::posix_time::ptime parseDateTime( std::string dateTimeStr );

/// Write a UTC time object to an xsd:dateTime string
LIBCMIS_API std::string writeDateTime( boost::posix_time::ptime time );

LIBCMIS_API bool parseBool( const std::string& str );
LIBCMIS_API bool parseBool( std::string str );

LIBCMIS_API long parseInteger( const std::string& str );
LIBCMIS_API long parseInteger( std::string str );

LIBCMIS_API double parseDouble( const std::string& str );
LIBCMIS_API double parseDouble( std::string str );

/** Trim spaces on the left and right of a string.
*/
Expand All @@ -159,9 +159,9 @@ namespace libcmis

LIBCMIS_API int stringstream_write_callback(void * context, const char * s, int len);

LIBCMIS_API std::string escape( const std::string& str );
LIBCMIS_API std::string escape( std::string str );

LIBCMIS_API std::string unescape( const std::string& str );
LIBCMIS_API std::string unescape( std::string str );
}

#endif
14 changes: 7 additions & 7 deletions src/libcmis/xml-utils.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ namespace libcmis
}
}

string getXPathValue( xmlXPathContextPtr xpathCtx, const string& req )
string getXPathValue( xmlXPathContextPtr xpathCtx, string req )
{
string value;
if ( xpathCtx != NULL )
Expand Down Expand Up @@ -387,7 +387,7 @@ namespace libcmis
return value;
}

boost::posix_time::ptime parseDateTime( const string& dateTimeStr )
boost::posix_time::ptime parseDateTime( string dateTimeStr )
{
boost::posix_time::ptime t( boost::date_time::not_a_date_time );
// Get the time zone offset
Expand Down Expand Up @@ -466,7 +466,7 @@ namespace libcmis
return str;
}

bool parseBool( const string& boolStr )
bool parseBool( string boolStr )
{
bool value = false;
if ( boolStr == "true" || boolStr == "1" )
Expand All @@ -478,7 +478,7 @@ namespace libcmis
return value;
}

long parseInteger( const string& intStr )
long parseInteger( string intStr )
{
char* end;
errno = 0;
Expand All @@ -497,7 +497,7 @@ namespace libcmis
return value;
}

double parseDouble( const string& doubleStr )
double parseDouble( string doubleStr )
{
char* end;
errno = 0;
Expand Down Expand Up @@ -559,13 +559,13 @@ namespace libcmis
return 0;
}

string escape( const string& str )
string escape( string str )
{
std::unique_ptr< char, void(*)( void* ) > escaped{ curl_easy_escape( NULL, str.c_str(), str.length() ), curl_free };
return escaped.get();
}

string unescape( const string& str )
string unescape( string str )
{
std::unique_ptr< char, void(*)( void* ) > unescaped{ curl_easy_unescape( NULL, str.c_str(), str.length(), NULL ), curl_free };
return unescaped.get();
Expand Down