Deprecate old IdString API with implizit global context
Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
parent
babd5f39ab
commit
3d7444ba9b
@ -90,46 +90,46 @@ struct IdString
|
||||
|
||||
// --- deprecated old API ---
|
||||
|
||||
IdString(const std::string &s)
|
||||
IdString(const std::string &s) __attribute__ ((deprecated))
|
||||
{
|
||||
assert(global_ctx != nullptr);
|
||||
set(global_ctx, s);
|
||||
}
|
||||
|
||||
IdString(const char *s)
|
||||
IdString(const char *s) __attribute__ ((deprecated))
|
||||
{
|
||||
assert(global_ctx != nullptr);
|
||||
set(global_ctx, s);
|
||||
}
|
||||
|
||||
const std::string &global_str() const
|
||||
const std::string &global_str() const __attribute__ ((deprecated))
|
||||
{
|
||||
assert(global_ctx != nullptr);
|
||||
return str(global_ctx);
|
||||
}
|
||||
|
||||
const std::string &str() const
|
||||
const std::string &str() const __attribute__ ((deprecated))
|
||||
{
|
||||
assert(global_ctx != nullptr);
|
||||
return str(global_ctx);
|
||||
}
|
||||
|
||||
const char *c_str() const
|
||||
const char *c_str() const __attribute__ ((deprecated))
|
||||
{
|
||||
assert(global_ctx != nullptr);
|
||||
return c_str(global_ctx);
|
||||
}
|
||||
|
||||
operator const char *() const { return c_str(); }
|
||||
operator const std::string &() const { return str(); }
|
||||
operator const char *() const __attribute__ ((deprecated)) { return c_str(); }
|
||||
operator const std::string &() const __attribute__ ((deprecated)) { return str(); }
|
||||
|
||||
bool operator==(const std::string &s) const { return str() == s; }
|
||||
bool operator==(const char *s) const { return str() == s; }
|
||||
bool operator==(const std::string &s) const __attribute__ ((deprecated)) { return str() == s; }
|
||||
bool operator==(const char *s) const __attribute__ ((deprecated)) { return str() == s; }
|
||||
|
||||
bool operator!=(const std::string &s) const { return str() != s; }
|
||||
bool operator!=(const char *s) const { return str() != s; }
|
||||
bool operator!=(const std::string &s) const __attribute__ ((deprecated)) { return str() != s; }
|
||||
bool operator!=(const char *s) const __attribute__ ((deprecated)) { return str() != s; }
|
||||
|
||||
size_t size() const { return str().size(); }
|
||||
size_t size() const __attribute__ ((deprecated)) { return str().size(); }
|
||||
};
|
||||
|
||||
NEXTPNR_NAMESPACE_END
|
||||
|
Loading…
Reference in New Issue
Block a user