-
Committer:
Stewart Smith
-
Date:
2009-12-04 05:55:24 UTC
-
mto:
(1240.3.7 build)
-
mto:
This revision was merged to the branch mainline in
revision
1241.
-
Revision ID:
stewart@flamingspork.com-20091204055524-zr2ikccqljzrykgf
start using a set of classes for database names, enforcing type safety when converting from what user entered to a normalised form.
we also start to remove check_db_name() which modifies its parameter!
The idea is that what comes in from the parser is a NonNormalisedDatabaseName,
it is completely raw, could be mixed case or anything.
You take this and construct a NormalisedDatabaseName, which is always in lower
case and all the good things one would expect.
You always change database to a NormalisedDatabaseName.
You can do some simple is_valid() checks (what was part of check_db_name()
that did *not* modify the argument) on a NormalisedDatabaseName, but doing
these on a NonNormalisedDatabaseName does not make any sense.
Once created, these objects are immutable, so should always be passed by
reference. To enforce this with compiler errors, we have a private and not
implemented copy constructor.