From afb3f2fbb7c649686e924f53e8df038b184776f2 Mon Sep 17 00:00:00 2001 From: Steven Watanabe Date: Sat, 31 Mar 2012 22:14:20 +0000 Subject: [PATCH] Copy the documentation from path.jam [SVN r77682] --- v2/doc/src/path.xml | 244 +++++++++++++++++++++++++++++++++++++++ v2/doc/src/reference.xml | 2 + 2 files changed, 246 insertions(+) create mode 100644 v2/doc/src/path.xml diff --git a/v2/doc/src/path.xml b/v2/doc/src/path.xml new file mode 100644 index 000000000..00d482a71 --- /dev/null +++ b/v2/doc/src/path.xml @@ -0,0 +1,244 @@ + + + +
+ + path + + path + + + + Performs various path manipulations. Paths are always in a 'normalized' + representation. In it, a path may be either: + + + '.', or + ['/'] [ ( '..' '/' )* (token '/')* token ] + + + In plain english, path can be rooted, '..' elements are allowed only at the + beginning, and it never ends in slash, except for path consisting of slash + only. + + + + + + + make + path + + rule make ( native ) + Converts the native path into normalized form. + + + + + native + + rule native ( path ) + Builds native representation of the path. + + + + + is-rooted + + rule is-rooted ( path ) + Tests if a path is rooted. + + + + + has-parent + + rule has-parent ( path ) + Tests if a path has a parent. + + + + + basename + + rule basename ( path ) + Returns the path without any directory components. + + + + + parent + + rule parent ( path ) + Returns parent directory of the path. If no parent exists, error is issued. + + + + + reverse + + rule reverse ( path ) + + Returns path2 such that + [ join path path2 ] = ".". + The path may not contain ".." + element or be rooted. + + + + + + join + + rule join ( elements + ) + + Concatenates the passed path elements. Generates an error if any + element other than the first one is rooted. Skips any empty or + undefined path elements. + + + + + + root + + rule root ( path root ) + + If path is relative, it is rooted at + root. Otherwise, it is unchanged. + + + + + + pwd + + rule pwd ( ) + Returns the current working directory. + + + + + glob + + rule glob ( dirs * : patterns + : exclude-patterns * ) + + Returns the list of files matching the given pattern in the specified + directory. Both directories and patterns are supplied as portable paths. Each + pattern should be non-absolute path, and can't contain "." or ".." elements. + Each slash separated element of pattern can contain the following special + characters: + + + '?', which match any character + + + '*', which matches arbitrary number of characters. + + + A file $(d)/e1/e2/e3 (where 'd' is in $(dirs)) matches pattern p1/p2/p3 if and + only if e1 matches p1, e2 matches p2 and so on. + + For example: + +[ glob . : *.cpp ] +[ glob . : */build/Jamfile ] + + + + + + + glob-tree + + rule glob-tree ( roots * : patterns + : exclude-patterns * ) + + Recursive version of glob. + Builds the glob of files while also searching in + the subdirectories of the given roots. An optional set of exclusion patterns + will filter out the matching entries from the result. The exclusions also + apply to the subdirectory scanning, such that directories that match the + exclusion patterns will not be searched. + + + + + + exists + + rule exists ( file ) + Returns true is the specified file exists. + + + + + all-parents + + rule all-parents ( path : upper_limit ? : cwd ? ) + + Find out the absolute name of path and returns the list of all the parents, + starting with the immediate one. Parents are returned as relative names. If + upper_limit is specified, directories above it + will be pruned. + + + + + + glob-in-parents + + rule glob-in-parents ( dir : patterns + : upper-limit ? ) + + Search for patterns in parent directories + of dir, up till and including + upper_limit, if it is specified, or + till the filesystem root otherwise. + + + + + + relative + + rule relative ( child parent : no-error ? ) + + Assuming child is a subdirectory of + parent, return the relative path from + parent to child. + + + + + + relative-to + + rule relative-to ( path1 path2 ) + Returns the minimal path to path2 that is relative path1. + + + + + programs-path + + rule programs-path ( ) + + Returns the list of paths which are used by the operating system for + looking up programs. + + + + + + mkdirs + + rule makedirs ( path ) + + Creates a directory and all parent directories that do not + already exist. + + + + + +
diff --git a/v2/doc/src/reference.xml b/v2/doc/src/reference.xml index 4869544bb..6edd377e4 100644 --- a/v2/doc/src/reference.xml +++ b/v2/doc/src/reference.xml @@ -1947,6 +1947,8 @@ import path : native make : native-path make-path ; + +