Meshroom/meshroom/ui/qml/filepath.js
Yann Lanthony 8d8bf0be5e [ui] better UI Components split + improvements
* add WorkspaceView that contains Meshroom main modules (ImageGallery, 2D/3D viewer)
* add Panel component to standardize UI modules layout
* ImageGallery: 
  * add images basename on image delegates
  * add explanatory placeholder when no image has been added to the reconstruction yet
2017-12-14 19:11:52 +01:00

17 lines
538 B
JavaScript

/* Utility functions to manipulate file paths */
/// Returns the directory name of the given path.
function dirname(path) {
return path.substring(0, path.lastIndexOf('/'))
}
/// Returns the basename (file.extension) of the given path.
function basename(path) {
return path.substring(path.lastIndexOf('/') + 1, path.length)
}
/// Return the extension (prefixed by a '.') of the given path.
function extension(path) {
var dot_pos = path.lastIndexOf('.');
return dot_pos > -1 ? path.substring(dot_pos, path.length) : ""
}