centralize legal-session-name-checkng and include : and ; in characters that we disallow, because they conflict with search path conventions on *nix and windows
git-svn-id: svn://localhost/ardour2/branches/3.0@10943 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -238,6 +238,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
||||
template<class T> void foreach_route (T *obj, void (T::*func)(boost::shared_ptr<Route>));
|
||||
template<class T, class A> void foreach_route (T *obj, void (T::*func)(Route&, A), A arg);
|
||||
|
||||
static char session_name_is_legal (const std::string&);
|
||||
bool io_name_is_legal (const std::string&);
|
||||
boost::shared_ptr<Route> route_by_name (std::string);
|
||||
boost::shared_ptr<Route> route_by_id (PBD::ID);
|
||||
|
||||
@@ -4543,3 +4543,16 @@ Session::update_latency_compensation (bool force_whole_graph)
|
||||
}
|
||||
}
|
||||
|
||||
char
|
||||
Session::session_name_is_legal (const string& path)
|
||||
{
|
||||
char illegal_chars[] = { '/', '\\', ':', ';', '\0' };
|
||||
|
||||
for (int i = 0; illegal_chars[i]; ++i) {
|
||||
if (path.find (illegal_chars[i]) != string::npos) {
|
||||
return illegal_chars[i];
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user