mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-06 08:05:18 -04:00
FeedReader:
- Remove "sid=" from link Moved stringToUpperCase and stringToLowerCase from rsinit.cc to util/rsstring.cc git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6029 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e66a9117e2
commit
0f26b85a88
4 changed files with 44 additions and 44 deletions
|
@ -201,28 +201,6 @@ bool RsInitConfig::udpListenerOnly;
|
|||
static bool getAvailableAccounts(std::list<accountId> &ids,int& failing_accounts,std::map<std::string,std::vector<std::string> >& unsupported_keys);
|
||||
static bool checkAccount(std::string accountdir, accountId &id,std::map<std::string,std::vector<std::string> >& unsupported_keys);
|
||||
|
||||
static std::string toUpperCase(const std::string& s)
|
||||
{
|
||||
std::string res(s) ;
|
||||
|
||||
for(uint32_t i=0;i<res.size();++i)
|
||||
if(res[i] > 96 && res[i] < 123)
|
||||
res[i] -= 97-65 ;
|
||||
|
||||
return res ;
|
||||
}
|
||||
|
||||
static std::string toLowerCase(const std::string& s)
|
||||
{
|
||||
std::string res(s) ;
|
||||
|
||||
for(uint32_t i=0;i<res.size();++i)
|
||||
if(res[i] > 64 && res[i] < 91)
|
||||
res[i] += 97-65 ;
|
||||
|
||||
return res ;
|
||||
}
|
||||
|
||||
void RsInit::InitRsConfig()
|
||||
{
|
||||
#ifndef WINDOWS_SYS
|
||||
|
@ -655,8 +633,10 @@ int RsInit::InitRetroShare(int argcIgnored, char **argvIgnored, bool strictCheck
|
|||
|
||||
// if a different user id has been passed to cmd line check for that instead
|
||||
|
||||
std::string lower_case_user_string = toLowerCase(prefUserString) ;
|
||||
std::string upper_case_user_string = toUpperCase(prefUserString) ;
|
||||
std::string lower_case_user_string;
|
||||
stringToLowerCase(prefUserString, lower_case_user_string) ;
|
||||
std::string upper_case_user_string;
|
||||
stringToUpperCase(prefUserString, upper_case_user_string) ;
|
||||
|
||||
bool pgpNameFound = false;
|
||||
if(prefUserString != "")
|
||||
|
|
|
@ -269,3 +269,21 @@ int rs_sprintf_append(std::string &str, const char *fmt, ...)
|
|||
|
||||
return retval;
|
||||
}
|
||||
|
||||
void stringToUpperCase(const std::string& s, std::string &upper)
|
||||
{
|
||||
upper = s ;
|
||||
|
||||
for(uint32_t i=0;i<upper.size();++i)
|
||||
if(upper[i] > 96 && upper[i] < 123)
|
||||
upper[i] -= 97-65 ;
|
||||
}
|
||||
|
||||
void stringToLowerCase(const std::string& s, std::string &lower)
|
||||
{
|
||||
lower = s ;
|
||||
|
||||
for(uint32_t i=0;i<lower.size();++i)
|
||||
if(lower[i] > 64 && lower[i] < 91)
|
||||
lower[i] += 97-65 ;
|
||||
}
|
||||
|
|
|
@ -42,4 +42,7 @@ bool ConvertUtf16ToUtf8(const std::wstring& source, std::string& dest);
|
|||
int rs_sprintf(std::string &str, const char *fmt, ...);
|
||||
int rs_sprintf_append(std::string &str, const char *fmt, ...);
|
||||
|
||||
void stringToUpperCase(const std::string& s, std::string &upper);
|
||||
void stringToLowerCase(const std::string& s, std::string &lower);
|
||||
|
||||
#endif // RSSTRING_H_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue