src/misc.cpp

changeset 8
e8f645d9f28f
parent 6
67b6ef6917ba
child 10
bc1414343e19
--- a/src/misc.cpp	Wed Jul 17 18:59:28 2013 +0300
+++ b/src/misc.cpp	Wed Jul 17 19:44:46 2013 +0300
@@ -8,4 +8,15 @@
 // -----------------------------------------------------------------------------
 str binaryConfigName( str ver ) {
 	return fmt( "binaries/%1", ver );
+}
+
+// =============================================================================
+// -----------------------------------------------------------------------------
+str basename( str path ) {
+	long lastpos = path.lastIndexOf( "/" );
+	
+	if( lastpos != -1 )
+		return path.mid( lastpos + 1 );
+	
+	return path;
 }
\ No newline at end of file

mercurial