SqlId::operator[](SqlId) as alternative to .Of

git-svn-id: svn://ultimatepp.org/upp/trunk@584 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2008-10-31 14:01:38 +00:00
parent 149f1afc77
commit 9487ebbf52
2 changed files with 7 additions and 1 deletions

View file

@ -12,6 +12,11 @@ SqlCol SqlId::Of(SqlId id) const
return id.IsNull() ? ToString() : id.ToString() + '.' + ToString();
}
SqlId SqlId::operator[](const SqlId& id) const
{
return id.IsNull() ? ToString() : ToString() + '.' + id.ToString();
}
SqlId SqlId::As(const char *as) const
{
return id.IsNull() ? ToString() : ToString() + SqlCase(MSSQL | PGSQL, " as ")(" ") + as;

View file

@ -106,8 +106,9 @@ public:
SqlCol Of(SqlId id) const;
SqlId As(const char *as) const;
SqlId As(SqlId id) const { return As(~~id); }
SqlId operator [] (int i) const;
SqlId operator[](int i) const;
SqlId operator&(const SqlId& s) const;
SqlId operator[](const SqlId& id) const;
SqlId() {}
SqlId(const char *s) : id(s) {}