move validDBName from Database to NamespaceString

This commit is contained in:
Eliot Horowitz
2011-11-16 15:29:43 -05:00
parent 51aa7535db
commit 2ea225cd7f
3 changed files with 26 additions and 8 deletions

View File

@@ -284,13 +284,6 @@ namespace mongo {
return true;
}
bool Database::validDBName( const string& ns ) {
if ( ns.size() == 0 || ns.size() > 64 )
return false;
size_t good = strcspn( ns.c_str() , "/\\. \"" );
return good == ns.size();
}
void Database::flushFiles( bool sync ) const {
dbMutex.assertAtLeastReadLocked();
for ( unsigned i=0; i<files.size(); i++ ) {