+FS::Path Component::get_temp_directory() const
+{
+ return package.get_temp_directory()/name;
+}
+
+string Component::flatten_source_path(const FS::Path &source) const
+{
+ FS::Path temp_dir = get_temp_directory();
+ FS::Path rel_src;
+ if(FS::descendant_depth(source, temp_dir)>=0)
+ rel_src = FS::relative(source, temp_dir);
+ else
+ rel_src = FS::relative(source, package.get_source_directory());
+
+ string fn;
+ for(const string &c: rel_src)
+ if(c!=".")
+ append(fn, "_", c);
+
+ return fn;
+}
+