mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
pass-thru object in assignment of primitive types (strings)
This commit is contained in:
@ -196,36 +196,41 @@ Foam::word Foam::fileName::component
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::fileName::operator=(const fileName& str)
|
||||
const Foam::fileName& Foam::fileName::operator=(const fileName& str)
|
||||
{
|
||||
string::operator=(str);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void Foam::fileName::operator=(const word& str)
|
||||
const Foam::fileName& Foam::fileName::operator=(const word& str)
|
||||
{
|
||||
string::operator=(str);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void Foam::fileName::operator=(const string& str)
|
||||
const Foam::fileName& Foam::fileName::operator=(const string& str)
|
||||
{
|
||||
string::operator=(str);
|
||||
stripInvalid();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void Foam::fileName::operator=(const std::string& str)
|
||||
const Foam::fileName& Foam::fileName::operator=(const std::string& str)
|
||||
{
|
||||
string::operator=(str);
|
||||
stripInvalid();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void Foam::fileName::operator=(const char* str)
|
||||
const Foam::fileName& Foam::fileName::operator=(const char* str)
|
||||
{
|
||||
string::operator=(str);
|
||||
stripInvalid();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -158,11 +158,11 @@ public:
|
||||
|
||||
// Assignment
|
||||
|
||||
void operator=(const fileName&);
|
||||
void operator=(const word&);
|
||||
void operator=(const string&);
|
||||
void operator=(const std::string&);
|
||||
void operator=(const char*);
|
||||
const fileName& operator=(const fileName&);
|
||||
const fileName& operator=(const word&);
|
||||
const fileName& operator=(const string&);
|
||||
const fileName& operator=(const std::string&);
|
||||
const fileName& operator=(const char*);
|
||||
|
||||
|
||||
// IOstream operators
|
||||
|
||||
@ -106,12 +106,12 @@ public:
|
||||
|
||||
// Assignment
|
||||
|
||||
inline void operator=(const keyType&);
|
||||
inline void operator=(const word&);
|
||||
inline const keyType& operator=(const keyType&);
|
||||
inline const keyType& operator=(const word&);
|
||||
|
||||
//- Assign from regular expression.
|
||||
inline void operator=(const string&);
|
||||
inline void operator=(const char*);
|
||||
inline const keyType& operator=(const string&);
|
||||
inline const keyType& operator=(const char*);
|
||||
|
||||
|
||||
// IOstream operators
|
||||
|
||||
@ -89,34 +89,38 @@ inline bool Foam::keyType::isPattern() const
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
inline void Foam::keyType::operator=(const keyType& s)
|
||||
inline const Foam::keyType& Foam::keyType::operator=(const keyType& s)
|
||||
{
|
||||
// Bypass checking
|
||||
string::operator=(s);
|
||||
isPattern_ = s.isPattern_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::keyType::operator=(const word& s)
|
||||
inline const Foam::keyType& Foam::keyType::operator=(const word& s)
|
||||
{
|
||||
word::operator=(s);
|
||||
isPattern_ = false;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::keyType::operator=(const string& s)
|
||||
inline const Foam::keyType& Foam::keyType::operator=(const string& s)
|
||||
{
|
||||
// Bypass checking
|
||||
string::operator=(s);
|
||||
isPattern_ = true;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::keyType::operator=(const char* s)
|
||||
inline const Foam::keyType& Foam::keyType::operator=(const char* s)
|
||||
{
|
||||
// Bypass checking
|
||||
string::operator=(s);
|
||||
isPattern_ = false;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -117,10 +117,10 @@ public:
|
||||
|
||||
// Assignment
|
||||
|
||||
inline void operator=(const word&);
|
||||
inline void operator=(const string&);
|
||||
inline void operator=(const std::string&);
|
||||
inline void operator=(const char*);
|
||||
inline const word& operator=(const word&);
|
||||
inline const word& operator=(const string&);
|
||||
inline const word& operator=(const std::string&);
|
||||
inline const word& operator=(const char*);
|
||||
|
||||
|
||||
// Friend Operators
|
||||
|
||||
@ -132,30 +132,34 @@ inline bool Foam::word::valid(char c)
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
inline void Foam::word::operator=(const word& q)
|
||||
inline const Foam::word& Foam::word::operator=(const word& q)
|
||||
{
|
||||
string::operator=(q);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::word::operator=(const string& q)
|
||||
inline const Foam::word& Foam::word::operator=(const string& q)
|
||||
{
|
||||
string::operator=(q);
|
||||
stripInvalid();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::word::operator=(const std::string& q)
|
||||
inline const Foam::word& Foam::word::operator=(const std::string& q)
|
||||
{
|
||||
string::operator=(q);
|
||||
stripInvalid();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::word::operator=(const char* q)
|
||||
inline const Foam::word& Foam::word::operator=(const char* q)
|
||||
{
|
||||
string::operator=(q);
|
||||
stripInvalid();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -187,22 +187,22 @@ public:
|
||||
|
||||
//- Assign copy
|
||||
// Always case sensitive
|
||||
inline void operator=(const wordRe&);
|
||||
inline const wordRe& operator=(const wordRe&);
|
||||
|
||||
//- Copy word, never a regular expression
|
||||
inline void operator=(const word&);
|
||||
inline const wordRe& operator=(const word&);
|
||||
|
||||
//- Copy string, auto-test for regular expression
|
||||
// Always case sensitive
|
||||
inline void operator=(const string&);
|
||||
inline const wordRe& operator=(const string&);
|
||||
|
||||
//- Copy string, auto-test for regular expression
|
||||
// Always case sensitive
|
||||
inline void operator=(const std::string&);
|
||||
inline const wordRe& operator=(const std::string&);
|
||||
|
||||
//- Copy string, auto-test for regular expression
|
||||
// Always case sensitive
|
||||
inline void operator=(const char*);
|
||||
inline const wordRe& operator=(const char*);
|
||||
|
||||
|
||||
// IOstream operators
|
||||
|
||||
@ -213,7 +213,7 @@ inline void Foam::wordRe::set(const char* str, const compOption opt)
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
inline void Foam::wordRe::operator=(const wordRe& str)
|
||||
inline const Foam::wordRe& Foam::wordRe::operator=(const wordRe& str)
|
||||
{
|
||||
string::operator=(str);
|
||||
|
||||
@ -225,34 +225,39 @@ inline void Foam::wordRe::operator=(const wordRe& str)
|
||||
{
|
||||
re_.clear();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::wordRe::operator=(const word& str)
|
||||
inline const Foam::wordRe& Foam::wordRe::operator=(const word& str)
|
||||
{
|
||||
word::operator=(str);
|
||||
re_.clear();
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::wordRe::operator=(const string& str)
|
||||
inline const Foam::wordRe& Foam::wordRe::operator=(const string& str)
|
||||
{
|
||||
string::operator=(str);
|
||||
compile(DETECT); // auto-detect regex
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::wordRe::operator=(const std::string& str)
|
||||
inline const Foam::wordRe& Foam::wordRe::operator=(const std::string& str)
|
||||
{
|
||||
string::operator=(str);
|
||||
compile(DETECT); // auto-detect regex
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline void Foam::wordRe::operator=(const char* str)
|
||||
inline const Foam::wordRe& Foam::wordRe::operator=(const char* str)
|
||||
{
|
||||
string::operator=(str);
|
||||
compile(DETECT); // auto-detect regex
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user