Made word/parameter constructor with 'string' explicit to avoid implicit use of default charset.
This commit is contained in:
parent
50b1dfcb05
commit
52e5d74bec
@ -639,7 +639,7 @@ static void connectStore()
|
||||
: std::string(path.begin() + s, path.begin() + p);
|
||||
|
||||
if (!x.empty())
|
||||
newFolder = newFolder->getFolder(x);
|
||||
newFolder = newFolder->getFolder(vmime::utility::path::component(x));
|
||||
|
||||
if (p == std::string::npos)
|
||||
break;
|
||||
|
@ -44,7 +44,7 @@ private:
|
||||
|
||||
public:
|
||||
|
||||
parameter(const string& name);
|
||||
explicit parameter(const string& name);
|
||||
parameter(const string& name, const word& value);
|
||||
parameter(const string& name, const string& value);
|
||||
|
||||
|
@ -537,14 +537,22 @@ const vmime::utility::file::path posixFileSystemFactory::stringToPathImpl(const
|
||||
while ((offset = str.find_first_of("/", offset)) != vmime::string::npos)
|
||||
{
|
||||
if (offset != prev)
|
||||
path.appendComponent(vmime::string(str.begin() + prev, str.begin() + offset));
|
||||
{
|
||||
path.appendComponent
|
||||
(vmime::utility::file::path::component
|
||||
(vmime::string(str.begin() + prev, str.begin() + offset)));
|
||||
}
|
||||
|
||||
prev = offset + 1;
|
||||
offset++;
|
||||
}
|
||||
|
||||
if (prev < str.length())
|
||||
path.appendComponent(vmime::string(str.begin() + prev, str.end()));
|
||||
{
|
||||
path.appendComponent
|
||||
(vmime::utility::file::path::component
|
||||
(vmime::string(str.begin() + prev, str.end())));
|
||||
}
|
||||
|
||||
return (path);
|
||||
}
|
||||
|
@ -69,14 +69,22 @@ const vmime::utility::file::path windowsFileSystemFactory::stringToPathImpl(cons
|
||||
while ((offset = str.find_first_of("\\", offset)) != vmime::string::npos)
|
||||
{
|
||||
if (offset != prev)
|
||||
path.appendComponent(vmime::string(str.begin() + prev, str.begin() + offset));
|
||||
{
|
||||
path.appendComponent
|
||||
(vmime::utility::file::path::component
|
||||
(vmime::string(str.begin() + prev, str.begin() + offset)));
|
||||
}
|
||||
|
||||
prev = offset + 1;
|
||||
offset++;
|
||||
}
|
||||
|
||||
if (prev < str.length())
|
||||
path.appendComponent(vmime::string(str.begin() + prev, str.end()));
|
||||
{
|
||||
path.appendComponent
|
||||
(vmime::utility::file::path::component
|
||||
(vmime::string(str.begin() + prev, str.end())));
|
||||
}
|
||||
|
||||
return (path);
|
||||
}
|
||||
|
@ -44,10 +44,34 @@ class VMIME_EXPORT word : public headerFieldValue
|
||||
|
||||
public:
|
||||
|
||||
/** Construct an empty word.
|
||||
* Charset is set to the current locale charset.
|
||||
*/
|
||||
word();
|
||||
|
||||
/** Construct a word by copying another word.
|
||||
*/
|
||||
word(const word& w);
|
||||
word(const string& buffer); // Defaults to local charset
|
||||
|
||||
/** Construct a word using a string buffer.
|
||||
* Charset is set to the current locale charset.
|
||||
*/
|
||||
explicit word(const string& buffer);
|
||||
|
||||
/** Construct a word using a string buffer and a specified charset.
|
||||
*
|
||||
* @param buffer string buffer
|
||||
* @param charset charset in which the string is encoded
|
||||
*/
|
||||
word(const string& buffer, const charset& charset);
|
||||
|
||||
/** Construct a word using a string buffer and a specified charset
|
||||
* and language tag (RFC-1766).
|
||||
*
|
||||
* @param buffer string buffer
|
||||
* @param charset charset in which the string is encoded
|
||||
* @param lang language tag, in the format specified by RFC-1766
|
||||
*/
|
||||
word(const string& buffer, const charset& charset, const string& lang);
|
||||
|
||||
/** Return the raw data for this encoded word.
|
||||
|
Loading…
Reference in New Issue
Block a user