Home · Overviews · Reference · Classes |
Helper class for dealing with filenames.
Returns a new file instance for the specified file name.
Returns the file extension.
var file = File("/home/qbuild/hello.txt");
// file.extension() == "txt"
Returns the file name.
var file = File("/home/qbuild/hello.txt");
// file.name() == "hello"
Returns the file path.
var file = File("/home/qbuild/hello.txt");
// file.path() == "/home/qbuild"
Returns the file without extension.
var file = File("/home/qbuild/hello.txt");
// file.stripextension() == "/home/qbuild/hello"
Returns the file name with spaces escaped.
var file = File("/home/qbuild/hello world.txt");
// file.stripextension() == "/home/qbuild/hello\ world.txt"
Returns the file with non-alphanumeric characters replaced with simple escaped versions. The resultant name will consist only of the characters, "a-zA-Z0-9_".
var file = File("myfilename*x.txt");
// file.simplename() == "myfilename_42x_46.txt"
Returns the canonical name of the file.
var file = File("foo/../bar");
// file.canonicalName() == "bar"
Returns true if this is a relative path (does not start with '/') otherwise false.
See also Javascript Binding.
Copyright © 2009 Nokia | Qt Extended - QBuild Maintainer Guide |