Commit 736b010f authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: string::assign instead of string::operator= in string sub-classes

- makes the meaning clearer
parent 9923f47c
......@@ -502,33 +502,33 @@ Foam::word Foam::fileName::component
void Foam::fileName::operator=(const fileName& str)
{
string::operator=(str);
assign(str);
}
void Foam::fileName::operator=(const word& str)
{
string::operator=(str);
assign(str);
}
void Foam::fileName::operator=(const string& str)
{
string::operator=(str);
assign(str);
stripInvalid();
}
void Foam::fileName::operator=(const std::string& str)
{
string::operator=(str);
assign(str);
stripInvalid();
}
void Foam::fileName::operator=(const char* str)
{
string::operator=(str);
assign(str);
stripInvalid();
}
......
......@@ -140,28 +140,28 @@ inline bool Foam::keyType::operator()(const std::string& text) const
inline void Foam::keyType::operator=(const keyType& s)
{
string::operator=(s); // Bypass char checking
assign(s); // Bypasses char checking
isPattern_ = s.isPattern_;
}
inline void Foam::keyType::operator=(const word& s)
{
string::operator=(s); // Bypass char checking
assign(s); // Bypasses char checking
isPattern_ = false;
}
inline void Foam::keyType::operator=(const string& s)
{
string::operator=(s); // Bypass char checking
assign(s); // Bypasses char checking
isPattern_ = true;
}
inline void Foam::keyType::operator=(const char* s)
{
string::operator=(s); // Bypass char checking
assign(s); // Bypasses char checking
isPattern_ = false;
}
......
......@@ -200,47 +200,47 @@ inline bool Foam::word::removeExt()
inline void Foam::word::operator=(const word& w)
{
string::operator=(w);
assign(w);
}
inline void Foam::word::operator=(word&& w)
{
string::operator=(std::move(w));
assign(std::move(w));
}
inline void Foam::word::operator=(const string& s)
{
string::operator=(s);
assign(s);
stripInvalid();
}
inline void Foam::word::operator=(string&& s)
{
string::operator=(std::move(s));
assign(std::move(s));
stripInvalid();
}
inline void Foam::word::operator=(const std::string& s)
{
string::operator=(s);
assign(s);
stripInvalid();
}
inline void Foam::word::operator=(std::string&& s)
{
string::operator=(std::move(s));
assign(std::move(s));
stripInvalid();
}
inline void Foam::word::operator=(const char* s)
{
string::operator=(s);
assign(s);
stripInvalid();
}
......
......@@ -242,14 +242,14 @@ inline Foam::string Foam::wordRe::quotemeta() const
inline void Foam::wordRe::set(const std::string& str, const compOption opt)
{
string::operator=(str);
assign(str);
compile(opt);
}
inline void Foam::wordRe::set(const char* str, const compOption opt)
{
string::operator=(str);
assign(str);
compile(opt);
}
......@@ -271,7 +271,7 @@ inline bool Foam::wordRe::operator()(const std::string& text) const
inline void Foam::wordRe::operator=(const wordRe& str)
{
string::operator=(str);
assign(str);
if (str.isPattern())
{
compile();
......@@ -285,14 +285,14 @@ inline void Foam::wordRe::operator=(const wordRe& str)
inline void Foam::wordRe::operator=(const word& str)
{
string::operator=(str);
assign(str);
re_.clear();
}
inline void Foam::wordRe::operator=(const keyType& str)
{
string::operator=(str);
assign(str);
if (str.isPattern())
{
compile();
......@@ -306,21 +306,21 @@ inline void Foam::wordRe::operator=(const keyType& str)
inline void Foam::wordRe::operator=(const string& str)
{
string::operator=(str);
assign(str);
compile(wordRe::DETECT); // Auto-detect regex
}
inline void Foam::wordRe::operator=(const std::string& str)
{
string::operator=(str);
assign(str);
compile(wordRe::DETECT); // Auto-detect regex
}
inline void Foam::wordRe::operator=(const char* str)
{
string::operator=(str);
assign(str);
compile(wordRe::DETECT); // Auto-detect regex
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment