Found 1008353 results in 95939 files, showing top 150 files (show more).
github.com/google/gapid:gapis/service/path/path.go: [ master, ]
15: package path
45: 	Path() *Any
60: func (n *API) Path() *Any                       { return &Any{Path: &Any_API{n}} }
61: func (n *ArrayIndex) Path() *Any                { return &Any{Path: &Any_ArrayIndex{n}} }
62: func (n *As) Path() *Any                        { return &Any{Path: &Any_As{n}} }
63: func (n *Blob) Path() *Any                      { return &Any{Path: &Any_Blob{n}} }
64: func (n *Capture) Path() *Any                   { return &Any{Path: &Any_Capture{n}} }
65: func (n *ConstantSet) Path() *Any               { return &Any{Path: &Any_ConstantSet{n}} }
66: func (n *Command) Path() *Any                   { return &Any{Path: &Any_Command{n}} }
67: func (n *Commands) Path() *Any                  { return &Any{Path: &Any_Commands{n}} }
68: func (n *CommandTree) Path() *Any               { return &Any{Path: &Any_CommandTree{n}} }
69: func (n *CommandTreeNode) Path() *Any           { return &Any{Path: &Any_CommandTreeNode{n}} }
70: func (n *CommandTreeNodeForCommand) Path() *Any { return &Any{Path: &Any_CommandTreeNodeForCommand{n}} }
71: func (n *Context) Path() *Any                   { return &Any{Path: &Any_Context{n}} }
72: func (n *Contexts) Path() *Any                  { return &Any{Path: &Any_Contexts{n}} }
73: func (n *Device) Path() *Any                    { return &Any{Path: &Any_Device{n}} }
74: func (n *DeviceTraceConfiguration) Path() *Any  { return &Any{Path: &Any_TraceConfig{n}} }
75: func (n *Events) Path() *Any                    { return &Any{Path: &Any_Events{n}} }
76: func (n *FramebufferObservation) Path() *Any    { return &Any{Path: &Any_FBO{n}} }
77: func (n *Field) Path() *Any                     { return &Any{Path: &Any_Field{n}} }
78: func (n *GlobalState) Path() *Any               { return &Any{Path: &Any_GlobalState{n}} }
79: func (n *ImageInfo) Path() *Any                 { return &Any{Path: &Any_ImageInfo{n}} }
80: func (n *MapIndex) Path() *Any                  { return &Any{Path: &Any_MapIndex{n}} }
81: func (n *Memory) Path() *Any                    { return &Any{Path: &Any_Memory{n}} }
82: func (n *MemoryAsType) Path() *Any              { return &Any{Path: &Any_MemoryAsType{n}} }
83: func (n *Mesh) Path() *Any                      { return &Any{Path: &Any_Mesh{n}} }
84: func (n *Metrics) Path() *Any                   { return &Any{Path: &Any_Metrics{n}} }
85: func (n *Parameter) Path() *Any                 { return &Any{Path: &Any_Parameter{n}} }
86: func (n *Pipelines) Path() *Any                 { return &Any{Path: &Any_Pipelines{n}} }
87: func (n *Report) Path() *Any                    { return &Any{Path: &Any_Report{n}} }
88: func (n *ResourceData) Path() *Any              { return &Any{Path: &Any_ResourceData{n}} }
89: func (n *Messages) Path() *Any                  { return &Any{Path: &Any_Messages{n}} }
90: func (n *MultiResourceData) Path() *Any         { return &Any{Path: &Any_MultiResourceData{n}} }
91: func (n *Resources) Path() *Any                 { return &Any{Path: &Any_Resources{n}} }
92: func (n *Result) Path() *Any                    { return &Any{Path: &Any_Result{n}} }
93: func (n *Slice) Path() *Any                     { return &Any{Path: &Any_Slice{n}} }
94: func (n *State) Path() *Any                     { return &Any{Path: &Any_State{n}} }
95: func (n *StateTree) Path() *Any                 { return &Any{Path: &Any_StateTree{n}} }
96: func (n *StateTreeNode) Path() *Any             { return &Any{Path: &Any_StateTreeNode{n}} }
98: func (n *Stats) Path() *Any                     { return &Any{Path: &Any_Stats{n}} }
99: func (n *Thumbnail) Path() *Any                 { return &Any{Path: &Any_Thumbnail{n}} }
100: func (n *Type) Path() *Any                      { return &Any{Path: &Any_Type{n}} }
97: func (n *StateTreeNodeForPath) Path() *Any      { return &Any{Path: &Any_StateTreeNodeForPath{n}} }
33: // command list, single command, memory, state or sub-object. A path can be
37: 	// Parent returns the path that this path derives from.
38: 	// If this path is a root, then Base returns nil.
41: 	// SetParent sets the path that this derives from.
44: 	// Path returns this path node as a path.
47: 	// Validate checks the path for correctness, returning an error if any
179: // Format implements fmt.Formatter to print the path.
184: // Format implements fmt.Formatter to print the path.
187: // Format implements fmt.Formatter to print the path.
192: // Format implements fmt.Formatter to print the path.
195: // Format implements fmt.Formatter to print the path.
198: // Format implements fmt.Formatter to print the path.
203: // Format implements fmt.Formatter to print the path.
208: // Format implements fmt.Formatter to print the path.
213: // Format implements fmt.Formatter to print the path.
216: // Format implements fmt.Formatter to print the path.
221: // Format implements fmt.Formatter to print the path.
226: // Format implements fmt.Formatter to print the path.
229: // Format implements fmt.Formatter to print the path.
232: // Format implements fmt.Formatter to print the path.
235: // Format implements fmt.Formatter to print the path.
238: // Format implements fmt.Formatter to print the path.
241: // Format implements fmt.Formatter to print the path.
244: // Format implements fmt.Formatter to print the path.
247: // Format implements fmt.Formatter to print the path.
250: // Format implements fmt.Formatter to print the path.
253: // Format implements fmt.Formatter to print the path
258: // Format implements fmt.Formatter to print the message path.
261: // Format implements fmt.Formatter to print the path.
264: // Format implements fmt.Formatter to print the path.
267: // Format implements fmt.Formatter to print the path.
270: // Format implements fmt.Formatter to print the path.
275: // Format implements fmt.Formatter to print the path.
280: // Format implements fmt.Formatter to print the path.
283: // Format implements fmt.Formatter to print the path.
286: // Format implements fmt.Formatter to print the path.
289: // Format implements fmt.Formatter to print the path.
294: // Format implements fmt.Formatter to print the path.
299: // Format implements fmt.Formatter to print the path.
302: // Format implements fmt.Formatter to print the path.
307: // Format implements fmt.Formatter to print the path.
312: // Format implements fmt.Formatter to print the path.
315: // Format implements fmt.Formatter to print the path.
459: // Node returns the path node for p.
460: func (p *Any) Node() Node { return oneOfNode(p.Path) }
462: // Format implements fmt.Formatter to print the path.
467: // FindCommand traverses the path nodes looking for a Command path node.
468: // If no Command path node was found then nil is returned.
479: // FindCapture traverses the path nodes looking for a Capture path node.
480: // If no Capture path node was found then nil is returned.
491: // NewAPI returns a new API path node with the given ID.
496: // NewCapture returns a new Capture path node with the given ID.
501: // NewDevice returns a new Device path node with the given ID.
506: // NewBlob returns a new Blob path node with the given ID.
511: // NewImageInfo returns a new ImageInfo path node with the given ID.
516: // NewField returns a new Field path.
523: // NewArrayIndex returns a new ArrayIndex path.
530: // NewMapIndex returns a new MapIndex path.
540: // NewSlice returns a new Slice path.
547: // ConstantSet returns a path to the API's i'th ConstantSet.
555: // Resources returns the path node to the capture's resources.
560: // Report returns the path node to the capture's report.
565: // Contexts returns the path node to the capture's contexts.
570: // Messages returns the path node to the capture's messages.
575: // Commands returns the path node to the capture's commands.
584: // CommandRange returns the path node to a range of the capture's commands.
593: // SubCommandRange returns the path node to a range of the capture's subcommands
602: // CommandTree returns the path to the root node of a capture's command tree
608: // Child returns the path to the i'th child of the CommandTreeNode.
616: // Command returns the path node to a single command in the capture.
622: // Context returns the path node to the a context with the given ID.
627: // Thread returns the path node to the thread with the given ID.
632: // MemoryAfter returns the path node to the memory after this command.
637: // ResourceAfter returns the path node to the resource with the given identifier
646: // ResourcesAfter returns the path node to the resources with the given
655: // FramebufferObservation returns the path node to framebuffer observation
661: // Mesh returns the path node to the mesh of this command.
689: // GlobalStateAfter returns the path node to the state after this command.
694: // StateAfter returns the path node to the state after this command.
699: // First returns the path to the first command.
704: // Last returns the path to the last command.
709: // Index returns the path to the i'th child of the StateTreeNode.
717: // Parameter returns the path node to the parameter with the given name.
722: // Result returns the path node to the command's result.
727: // Tree returns the path node to the state tree for this state.
139: func (n StateTreeNodeForPath) Parent() Node      { return nil }
175: func (n *StateTreeNodeForPath) SetParent(p Node)      {}
308: func (n StateTreeNodeForPath) Format(f fmt.State, c rune) {
794: // ShallowEqual returns true if paths a and b are equal (ignoring parents).
android.googlesource.com/platform/external/python/parse_type:tasks/_vendor/pathlib.py: [ master, ]
928: class Path(PurePath):
210:     def _split_extended_path(self, s, ext_prefix=ext_namespace_prefix):
134:     pathmod = ntpath
253:     pathmod = posixpath
565: class PurePath(object):
844:     def joinpath(self, *args):
915: class PurePosixPath(PurePath):
920: class PureWindowsPath(PurePath):
952:     def _make_child_relpath(self, part):
1275: class PosixPath(Path, PurePosixPath):
1278: class WindowsPath(Path, PureWindowsPath):
537: class _PathParents(Sequence):
40:         _getfinalpathname = None
45:     "Path", "PosixPath", "WindowsPath",
67:     """A flavour implements a particular (platform-specific) set of path
119:                 # Same drive => second path is relative to the first
122:             # Second path is non-anchored (common case)
162:             prefix, part = self._split_extended_path(part)
169:             # is a UNC path:
176:                 # a UNC path can't have two slashes in a row
201:     def resolve(self, path):
202:         s = str(path)
221:         # Turn back an extended path into a normal DOS-like path
222:         return self._split_extended_path(s)[1]
236:     def make_uri(self, path):
238:         drive = path.drive
240:             # It's a path on a local drive => 'file:///c:/a/b'
241:             rest = path.as_posix()[2:].lstrip('/')
245:             # It's a path on a network drive => 'file://host/share/a/b'
246:             return 'file:' + urlquote_from_bytes(path.as_posix().encode('utf-8'))
260:             # According to POSIX path resolution:
278:     def resolve(self, path):
280:         accessor = path._accessor
282:         def _resolve(path, rest):
284:                 path = ''
292:                     path, _, _ = path.rpartition(sep)
294:                 newpath = path + sep + name
296:                     # Already seen this path
297:                     path = seen[newpath]
298:                     if path is not None:
310:                     path = newpath
313:                     path = _resolve(path, target)
314:                     seen[newpath] = path # resolved symlink
316:             return path
317:         # NOTE: according to POSIX, getcwd() cannot contain path components
319:         base = '' if path.is_absolute() else os.getcwd()
320:         return _resolve(base, str(path)) or sep
325:     def make_uri(self, path):
326:         # We represent the path using the local filesystem encoding,
328:         bpath = bytes(path)
397:     def readlink(self, path):
398:         return os.readlink(path)
433:         raise ValueError("Invalid pattern: '**' can only be an entire path component")
446:     of a given path."""
455:     def select_from(self, parent_path):
456:         """Iterate over all child paths of `parent_path` matched by this
457:         selector.  This can contain parent_path itself."""
458:         path_cls = type(parent_path)
459:         is_dir = path_cls.is_dir
460:         exists = path_cls.exists
461:         listdir = parent_path._accessor.listdir
462:         return self._select_from(parent_path, is_dir, exists, listdir)
467:     def _select_from(self, parent_path, is_dir, exists, listdir):
468:         yield parent_path
477:     def _select_from(self, parent_path, is_dir, exists, listdir):
478:         if not is_dir(parent_path):
480:         path = parent_path._make_child_relpath(self.name)
481:         if exists(path):
482:             for p in self.successor._select_from(path, is_dir, exists, listdir):
492:     def _select_from(self, parent_path, is_dir, exists, listdir):
493:         if not is_dir(parent_path):
495:         cf = parent_path._flavour.casefold
496:         for name in listdir(parent_path):
499:                 path = parent_path._make_child_relpath(name)
500:                 for p in self.successor._select_from(path, is_dir, exists, listdir):
509:     def _iterate_directories(self, parent_path, is_dir, listdir):
510:         yield parent_path
511:         for name in listdir(parent_path):
512:             path = parent_path._make_child_relpath(name)
513:             if is_dir(path):
514:                 for p in self._iterate_directories(path, is_dir, listdir):
517:     def _select_from(self, parent_path, is_dir, exists, listdir):
518:         if not is_dir(parent_path):
524:                 for starting_point in self._iterate_directories(parent_path, is_dir, listdir):
539:     of a path.  Don't try to construct it yourself."""
542:     def __init__(self, path):
544:         self._pathcls = type(path)
545:         self._drv = path._drv
546:         self._root = path._root
547:         self._parts = path._parts
566:     """PurePath represents a filesystem path and offers operations which
579:         PurePath objects.  The strings and path objects are combined so as
580:         to yield a canonicalized path, which is incorporated into the
588:         # Using the parts tuple helps share interned path parts
604:                     "argument should be a path or str object, not %r"
639:         # Overriden in concrete Path
649:         """Return the string representation of the path, suitable for
659:         """Return the string representation of the path with forward (/)
665:         """Return the bytes representation of the path.  This is only
675:         """Return the path as a 'file' URI."""
677:             raise ValueError("relative path can't be expressed as a file URI")
725:                      doc="""The drive prefix (letter or UNC path), if any.""")
728:                     doc="""The root of the path, if any.""")
738:         """The final path component, if any."""
765:         """The final path component, minus its last suffix."""
774:         """Return a new path with the file name changed."""
781:         """Return a new path with the file suffix changed (or added, if none)."""
801:         """Return the relative path to another path identified by the passed
803:         a subpath of the other path), raise ValueError.
807:         #   Path('c:/').relative_to('c:')  gives Path('/')
808:         #   Path('c:/').relative_to('/')   raise ValueError
835:         components in the filesystem path."""
845:         """Combine this path with one or several arguments, and return a
846:         new path representing either a subpath (if all arguments are relative
847:         paths) or a totally different path (if one of the arguments is
864:         """The logical parent of the path."""
874:         """A sequence of this path's logical parents."""
878:         """True if the path is absolute (has both a root and, if applicable,
885:         """Return True if the path contains one of the special names reserved
889:     def match(self, path_pattern):
891:         Return True if this path matches the given pattern.
894:         path_pattern = cf(path_pattern)
895:         drv, root, pat_parts = self._flavour.parse_parts((path_pattern,))
934:         if cls is Path:
954:         # a single part relative to this path.
964:         Open the file pointed by this path and return a file descriptor,
973:         """Return a new path pointing to the current working directory
984:                 # Yielding a path object for these makes little sense
1013:         """Return an absolute version of this path.  This function works
1014:         even if the path doesn't point to anything.
1017:         Use resolve() to get the canonical path to a file.
1030:         Make the path absolute, resolving all symlinks on the way and also
1037:             # the path doesn't exist or is forbidden
1040:         # Now we have no symlinks in the path, it's safe to normalize it.
1048:         Return the result of the stat() system call on this path, like
1070:         Open the file pointed by this path and return a file object, as
1115:         Change the permissions of the path, like os.chmod().
1121:         Like chmod(), except if the path points to a symlink, the symlink's
1129:         If the path is a directory, use rmdir() instead.
1141:         Like stat(), except if the path points to a symlink, the symlink's
1148:         Rename this path to the given path.
1154:         Rename this path to the given path, clobbering the existing
1164:         Make this path a symlink pointing to the given path.
1173:         Whether this path exists.
1185:         Whether this path is a directory.
1192:             # Path doesn't exist or is a broken symlink
1198:         Whether this path is a regular file (also True for symlinks pointing
1206:             # Path doesn't exist or is a broken symlink
1212:         Whether this path is a symbolic link.
1219:             # Path doesn't exist
1224:         Whether this path is a block device.
1231:             # Path doesn't exist or is a broken symlink
1237:         Whether this path is a character device.
1244:             # Path doesn't exist or is a broken symlink
1250:         Whether this path is a FIFO.
1257:             # Path doesn't exist or is a broken symlink
1263:         Whether this path is a socket.
1270:             # Path doesn't exist or is a broken symlink
4: import ntpath
6: import posixpath
44:     "PurePath", "PurePosixPath", "PureWindowsPath",
111:         Join the two paths represented by the respective
128:     # Reference for Windows paths can be found at
150:     # Interesting findings about extended paths:
153:     # - extended paths are always absolute; "relative" extended paths will
160:             # XXX extended paths should also disable the collapsing of "."
227:         # We err on the side of caution and return True for paths which are
232:             # UNC paths are never reserved
262:             # "A pathname that begins with two successive slashes may be
295:                 if newpath in seen:
302:                     raise RuntimeError("Symlink loop from %r" % newpath)
305:                     target = accessor.readlink(newpath)
312:                     seen[newpath] = None # not resolved symlink
329:         return 'file://' + urlquote_from_bytes(bpath)
338:     accessing paths on the filesystem."""
345:         def wrapped(pathobj, *args):
346:             return strfunc(str(pathobj), *args)
351:         def wrapped(pathobjA, pathobjB, *args):
352:             return strfunc(str(pathobjA), str(pathobjB), *args)
368:         def lchmod(self, pathobj, mode):
540:     __slots__ = ('_pathcls', '_drv', '_root', '_parts')
558:         return self._pathcls._from_parsed_parts(self._drv, self._root,
562:         return "<{0}.parents>".format(self._pathcls.__name__)
568:     instantiating a PurePath will return either a PurePosixPath or a
569:     PureWindowsPath object.  You can also instantiate either of these classes
578:         """Construct a PurePath from one or several strings and or existing
581:         new PurePath object.
583:         if cls is PurePath:
584:             cls = PureWindowsPath if os.name == 'nt' else PurePosixPath
589:         # when pickling related paths.
598:             if isinstance(a, PurePath):
690:         if not isinstance(other, PurePath):
705:         if not isinstance(other, PurePath) or self._flavour is not other._flavour:
710:         if not isinstance(other, PurePath) or self._flavour is not other._flavour:
715:         if not isinstance(other, PurePath) or self._flavour is not other._flavour:
720:         if not isinstance(other, PurePath) or self._flavour is not other._flavour:
875:         return _PathParents(self)
935:             cls = WindowsPath if os.name == 'nt' else PosixPath
980:         result for the special paths '.' and '..'.
986:             yield self._make_child_relpath(name)
1041:         normed = self._flavour.pathmod.normpath(s)
1193:             # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
1207:             # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
1232:             # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
1245:             # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
1258:             # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
1271:             # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
37:         from nt import _getfinalpathname
205:         if _getfinalpathname is not None:
206:             return self._ext_to_normal(_getfinalpathname(s))
1023:         # use nt._getfullpathname())
github.com/apache/incubator-teaclave-sgx-sdk:sgx_tstd/src/path.rs: [ master, ]
419:     path: &'a [u8],
1248: impl ToOwned for Path {
1308: pub struct Path {
1323: impl Path {
1780: impl AsRef<OsStr> for Path {
1786: impl fmt::Debug for Path {
1799:     path: &'a Path,
1814: impl cmp::PartialEq for Path {
1820: impl Hash for Path {
1828: impl cmp::Eq for Path {}
1830: impl cmp::PartialOrd for Path {
1836: impl cmp::Ord for Path {
1842: impl AsRef<Path> for Path {
1890: impl<'a> IntoIterator for &'a Path {
522:     pub fn as_path(&self) -> &'a Path {
653:     pub fn as_path(&self) -> &'a Path {
876:     pub fn as_path(&self) -> &Path {
1015:     pub fn into_boxed_path(self) -> Box<Path> {
848: pub struct PathBuf {
852: impl PathBuf {
1077: impl From<Box<Path>> for PathBuf {
1103: impl<T: ?Sized + AsRef<OsStr>> From<&T> for PathBuf {
1109: impl From<OsString> for PathBuf {
1127: impl From<String> for PathBuf {
1136: impl FromStr for PathBuf {
1144: impl<P: AsRef<Path>> iter::FromIterator<P> for PathBuf {
1152: impl<P: AsRef<Path>> iter::Extend<P> for PathBuf {
1158: impl fmt::Debug for PathBuf {
1164: impl ops::Deref for PathBuf {
1172: impl Borrow<Path> for PathBuf {
1178: impl Default for PathBuf {
1205: impl<'a> From<Cow<'a, Path>> for PathBuf {
1258: impl cmp::PartialEq for PathBuf {
1264: impl Hash for PathBuf {
1270: impl cmp::Eq for PathBuf {}
1272: impl cmp::PartialOrd for PathBuf {
1278: impl cmp::Ord for PathBuf {
1284: impl AsRef<OsStr> for PathBuf {
1878: impl AsRef<Path> for PathBuf {
1884: impl<'a> IntoIterator for &'a PathBuf {
1377:     pub fn to_path_buf(&self) -> PathBuf {
1773:     pub fn into_path_buf(self: Box<Path>) -> PathBuf {
29: //! Cross-platform path manipulation.
31: //! This module provides two types, [`PathBuf`] and [`Path`][`Path`] (akin to [`String`]
34: //! on strings according to the local platform's path syntax.
37: //! returned by the [`components`] method on [`Path`]. [`Component`]s roughly
38: //! correspond to the substrings between path separators (`/` or `\`). You can
39: //! reconstruct an equivalent path from components with the [`push`] method on
49: use crate::sys::path::{is_sep_byte, is_verbatim_sep, MAIN_SEP_STR, parse_prefix};
76: /// Windows path prefixes, e.g., `C:` or `\\server\share`.
78: /// Windows uses a variety of path prefix styles, including references to drive
80: /// others. In addition, some path prefixes are "verbatim" (i.e., prefixed with
182: /// Determines whether the character is one of the permitted path
189: /// The primary separator of path components for the current platform.
192: pub const MAIN_SEPARATOR: char = crate::sys::path::MAIN_SEP;
232:     let path = if let Some(p) = prefix {
237:     !path.is_empty() && is_sep_byte(path[0])
269: /// front and back of the path each keep track of what parts of the path have
272: /// Going front to back, a path is made up of a prefix, a starting
282: /// A structure wrapping a Windows path prefix as well as its unparsed string
346: /// A single component of a path.
348: /// A `Component` roughly corresponds to a substring between path separators
352: /// created by the [`components`][`Path::components`] method on [`Path`].
357:     /// A Windows path prefix, e.g., `C:` or `\\server\share`.
369:     /// It represents a separator that designates that a path starts from root.
394:             Component::Normal(path) => path,
405: impl AsRef<Path> for Component<'_> {
406:     fn as_ref(&self) -> &Path {
411: /// An iterator over the [`Component`]s of a [`Path`].
413: /// This `struct` is created by the [`components`] method on [`Path`].
418:     // The path left to parse components from
424:     // true if path *physically* has a root separator; for most Windows
435: /// An iterator over the [`Component`]s of a [`Path`], as [`OsStr`] slices.
437: /// This `struct` is created by the [`iter`] method on [`Path`].
441: /// [`iter`]: struct.Path.html#method.iter
443: /// [`Path`]: struct.Path.html
451:         struct DebugHelper<'a>(&'a Path);
462:             .field(&DebugHelper(self.as_path()))
489:     // Given the iteration so far, how much of the pre-State::Body path is left?
520:     /// Extracts a slice corresponding to the portion of the path remaining for iteration.
530:         unsafe { Path::from_u8_slice(comps.path) }
533:     /// Is the *original* path rooted?
546:     /// Should the normalized path include a leading . ?
551:         let mut iter = self.path[self.prefix_len()..].iter();
559:     // parse a given byte sequence into the corresponding path component
564:                           // the beginning of a path, which is treated
576:         let (extra, comp) = match self.path.iter().position(|b| self.is_sep_byte(*b)) {
577:             None => (0, self.path),
578:             Some(i) => (1, &self.path[..i]),
588:         let (extra, comp) = match self.path[start..].iter().rposition(|b| self.is_sep_byte(*b)) {
589:             None => (0, &self.path[start..]),
590:             Some(i) => (1, &self.path[start + i + 1..]),
597:         while !self.path.is_empty() {
602:                 self.path = &self.path[size..];
609:         while self.path.len() > self.len_before_body() {
614:                 self.path = &self.path[..self.path.len() - size];
620: impl AsRef<Path> for Components<'_> {
621:     fn as_ref(&self) -> &Path {
622:         self.as_path()
628:         self.as_path().as_os_str()
634:         struct DebugHelper<'a>(&'a Path);
645:             .field(&DebugHelper(self.as_path()))
651:     /// Extracts a slice corresponding to the portion of the path remaining for iteration.
654:         self.inner.as_path()
658: impl AsRef<Path> for Iter<'_> {
659:     fn as_ref(&self) -> &Path {
660:         self.as_path()
666:         self.as_path().as_os_str()
694:                     debug_assert!(self.prefix_len() <= self.path.len());
695:                     let raw = &self.path[..self.prefix_len()];
696:                     self.path = &self.path[self.prefix_len()..];
708:                         debug_assert!(!self.path.is_empty());
709:                         self.path = &self.path[1..];
716:                         debug_assert!(!self.path.is_empty());
717:                         self.path = &self.path[1..];
721:                 State::Body if !self.path.is_empty() => {
723:                     self.path = &self.path[size..];
742:                 State::Body if self.path.len() > self.len_before_body() => {
744:                     self.path = &self.path[..self.path.len() - size];
755:                         self.path = &self.path[..self.path.len() - 1];
762:                         self.path = &self.path[..self.path.len() - 1];
769:                         raw: unsafe { u8_slice_as_os_str(self.path) },
806: /// An iterator over [`Path`] and its ancestors.
808: /// This `struct` is created by the [`ancestors`] method on [`Path`].
813:     next: Option<&'a Path>,
817:     type Item = &'a Path;
821:         self.next = next.and_then(Path::parent);
832: /// An owned, mutable path (akin to [`String`]).
835: /// the path in place. It also implements [`Deref`] to [`Path`], meaning that
836: /// all methods on [`Path`] slices are available on `PathBuf` values as well.
839: /// [`Path`]: struct.Path.html
872:     /// Coerces to a [`Path`] slice.
874:     /// [`Path`]: struct.Path.html
880:     /// Extends `self` with `path`.
882:     /// If `path` is absolute, it replaces the current path.
886:     /// * if `path` has a root but no prefix (e.g., `\windows`), it
888:     /// * if `path` has a prefix but no root, it replaces `self`.
890:     pub fn push<P: AsRef<Path>>(&mut self, path: P) {
891:         self._push(path.as_ref())
894:     fn _push(&mut self, path: &Path) {
901:             if comps.prefix_len() > 0 && comps.prefix_len() == comps.path.len() &&
907:         // absolute `path` replaces `self`
908:         if path.is_absolute() || path.prefix().is_some() {
911:         // `path` has a root but no prefix, e.g., `\windows` (Windows only)
912:         } else if path.has_root() {
916:         // `path` is a pure relative path
921:         self.inner.push(path);
949:     /// `file_name`. The new path will be a sibling of the original path.
1011:     /// Converts this `PathBuf` into a [boxed][`Box`] [`Path`].
1014:     /// [`Path`]: struct.Path.html
1016:         let rw = Box::into_raw(self.inner.into_boxed_os_str()) as *mut Path;
1069: impl From<&Path> for Box<Path> {
1070:     fn from(path: &Path) -> Box<Path> {
1071:         let boxed: Box<OsStr> = path.inner.into();
1072:         let rw = Box::into_raw(boxed) as *mut Path;
1078:     /// Converts a `Box<Path>` into a `PathBuf`
1081:     fn from(boxed: Box<Path>) -> PathBuf {
1082:         boxed.into_path_buf()
1086: impl From<PathBuf> for Box<Path> {
1087:     /// Converts a `PathBuf` into a `Box<Path>`
1091:     fn from(p: PathBuf) -> Box<Path> {
1092:         p.into_boxed_path()
1096: impl Clone for Box<Path> {
1099:         self.to_path_buf().into_boxed_path()
1122:     fn from(path_buf : PathBuf) -> OsString {
1123:         path_buf.inner
1165:     type Target = Path;
1167:     fn deref(&self) -> &Path {
1168:         Path::new(&self.inner)
1173:     fn borrow(&self) -> &Path {
1184: impl<'a> From<&'a Path> for Cow<'a, Path> {
1186:     fn from(s: &'a Path) -> Cow<'a, Path> {
1191: impl<'a> From<PathBuf> for Cow<'a, Path> {
1193:     fn from(s: PathBuf) -> Cow<'a, Path> {
1198: impl<'a> From<&'a PathBuf> for Cow<'a, Path> {
1200:     fn from(p: &'a PathBuf) -> Cow<'a, Path> {
1201:         Cow::Borrowed(p.as_path())
1207:     fn from(p: Cow<'a, Path>) -> Self {
1212: impl From<PathBuf> for Arc<Path> {
1213:     /// Converts a Path into a Rc by copying the Path data into a new Rc buffer.
1215:     fn from(s: PathBuf) -> Arc<Path> {
1217:         unsafe { Arc::from_raw(Arc::into_raw(arc) as *const Path) }
1221: impl From<&Path> for Arc<Path> {
1222:     /// Converts a Path into a Rc by copying the Path data into a new Rc buffer.
1224:     fn from(s: &Path) -> Arc<Path> {
1226:         unsafe { Arc::from_raw(Arc::into_raw(arc) as *const Path) }
1230: impl From<PathBuf> for Rc<Path> {
1231:     /// Converts a Path into a Rc by copying the Path data into a new Rc buffer.
1233:     fn from(s: PathBuf) -> Rc<Path> {
1235:         unsafe { Rc::from_raw(Rc::into_raw(rc) as *const Path) }
1239: impl From<&Path> for Rc<Path> {
1240:     /// Converts a Path into a Rc by copying the Path data into a new Rc buffer.
1242:     fn from(s: &Path) -> Rc<Path> {
1244:         unsafe { Rc::from_raw(Rc::into_raw(rc) as *const Path) }
1251:         self.to_path_buf()
1266:         self.as_path().hash(h)
1290: /// A slice of a path (akin to [`str`]).
1292: /// This type supports a number of operations for inspecting a path, including
1293: /// breaking the path into its components (separated by `/` on Unix and by either
1294: /// `/` or `\` on Windows), extracting the file name, determining whether the path
1312: /// An error returned from [`Path::strip_prefix`][`strip_prefix`] if the prefix
1315: /// This `struct` is created by the [`strip_prefix`] method on [`Path`].
1318: /// [`strip_prefix`]: struct.Path.html#method.strip_prefix
1319: /// [`Path`]: struct.Path.html
1324:     // The following (private!) function allows construction of a path from a u8
1326:     unsafe fn from_u8_slice(s: &[u8]) -> &Path {
1327:         Path::new(u8_slice_as_os_str(s))
1334:     /// Directly wraps a string slice as a `Path` slice.
1338:     pub fn new<S: AsRef<OsStr> + ?Sized>(s: &S) -> &Path {
1339:         unsafe { &*(s.as_ref() as *const OsStr as *const Path) }
1350:     /// Yields a [`&str`] slice if the `Path` is valid unicode.
1360:     /// Converts a `Path` to a [`Cow<str>`].
1372:     /// Converts a `Path` to an owned [`PathBuf`].
1381:     /// Returns `true` if the `Path` is absolute, i.e., if it is independent of
1384:     /// * On Unix, a path is absolute if it starts with the root, so
1387:     /// * On Windows, a path is absolute if it has a prefix and starts with the
1395:     /// Returns `true` if the `Path` is relative, i.e., not absolute.
1407:     /// Returns `true` if the `Path` has a root.
1409:     /// * On Unix, a path has a root if it begins with `/`.
1411:     /// * On Windows, a path has a root if it:
1420:     /// Returns the `Path` without its final component, if there is one.
1422:     /// Returns [`None`] if the path terminates in a root or prefix.
1426:     pub fn parent(&self) -> Option<&Path> {
1433:                 Component::ParentDir => Some(comps.as_path()),
1439:     /// Produces an iterator over `Path` and its ancestors.
1441:     /// The iterator will yield the `Path` that is returned if the [`parent`] method is used zero
1453:     /// Returns the final component of the `Path`, if there is one.
1455:     /// If the path is a normal file, this is the file name. If it's the path of a directory, this
1458:     /// Returns [`None`] if the path terminates in `..`.
1471:     /// Returns a path that, when joined onto `base`, yields `self`.
1482:                            -> Result<&Path, StripPrefixError>
1483:         where P: AsRef<Path>
1488:     fn _strip_prefix(&self, base: &Path)
1489:                      -> Result<&Path, StripPrefixError> {
1491:             .map(|c| c.as_path())
1497:     /// Only considers whole path components to match.
1499:     pub fn starts_with<P: AsRef<Path>>(&self, base: P) -> bool {
1503:     fn _starts_with(&self, base: &Path) -> bool {
1509:     /// Only considers whole path components to match.
1511:     pub fn ends_with<P: AsRef<Path>>(&self, child: P) -> bool {
1515:     fn _ends_with(&self, child: &Path) -> bool {
1521:     /// [`self.file_name`]: struct.Path.html#method.file_name
1545:     /// [`self.file_name`]: struct.Path.html#method.file_name
1552:     /// Creates an owned [`PathBuf`] with `path` adjoined to `self`.
1554:     /// See [`PathBuf::push`] for more details on what it means to adjoin a path.
1559:     pub fn join<P: AsRef<Path>>(&self, path: P) -> PathBuf {
1560:         self._join(path.as_ref())
1563:     fn _join(&self, path: &Path) -> PathBuf {
1564:         let mut buf = self.to_path_buf();
1565:         buf.push(path);
1581:         let mut buf = self.to_path_buf();
1598:         let mut buf = self.to_path_buf();
1603:     /// Produces an iterator over the [`Component`]s of the path.
1605:     /// When parsing the path, there is a small amount of normalization:
1611:     ///   beginning of the path. For example, `a/./b`, `a/b/`, `a/b/.` and
1624:             path: self.as_u8_slice(),
1632:     /// Produces an iterator over the path's components viewed as [`OsStr`]
1635:     /// For more information about the particulars of how the path is separated
1651:         Display { path: self }
1679:     /// Returns the canonical, absolute form of the path with all intermediate
1716:     /// use std::path::Path;
1718:     /// let path = Path::new("/laputa");
1719:     /// for entry in path.read_dir().expect("read_dir call failed") {
1721:     ///         println!("{:?}", entry.path());
1729:     /// Returns whether the path points at an existing entity.
1742:     /// Returns `true` if the path exists on disk and is pointing at a regular file.
1755:     /// Returns `true` if the path exists on disk and is pointing at a directory.
1768:     /// Converts a [`Box<Path>`][`Box`] into a [`PathBuf`] without copying or
1794: /// A [`Path`] might contain non-Unicode data. This `struct` implements the
1796: /// [`display`][`Path::display`] method on [`Path`].
1804:         fmt::Debug::fmt(&self.path, f)
1810:         self.path.inner.display(f)
1815:     fn eq(&self, other: &Path) -> bool {
1831:     fn partial_cmp(&self, other: &Path) -> Option<cmp::Ordering> {
1837:     fn cmp(&self, other: &Path) -> cmp::Ordering {
1843:     fn as_ref(&self) -> &Path {
1848: impl AsRef<Path> for OsStr {
1849:     fn as_ref(&self) -> &Path {
1850:         Path::new(self)
1854: impl AsRef<Path> for Cow<'_, OsStr> {
1855:     fn as_ref(&self) -> &Path {
1856:         Path::new(self)
1860: impl AsRef<Path> for OsString {
1861:     fn as_ref(&self) -> &Path {
1862:         Path::new(self)
1866: impl AsRef<Path> for str {
1867:     fn as_ref(&self) -> &Path {
1868:         Path::new(self)
1872: impl AsRef<Path> for String {
1873:     fn as_ref(&self) -> &Path {
1874:         Path::new(self)
1879:     fn as_ref(&self) -> &Path {
1900:             fn eq(&self, other: &$rhs) -> bool { <Path as PartialEq>::eq(self, other) }
1905:             fn eq(&self, other: &$lhs) -> bool { <Path as PartialEq>::eq(self, other) }
1911:                 <Path as PartialOrd>::partial_cmp(self, other)
1918:                 <Path as PartialOrd>::partial_cmp(self, other)
1924: impl_cmp!(PathBuf, Path);
1925: impl_cmp!(PathBuf, &'a Path);
1926: impl_cmp!(Cow<'a, Path>, Path);
1927: impl_cmp!(Cow<'a, Path>, &'b Path);
1928: impl_cmp!(Cow<'a, Path>, PathBuf);
1934:             fn eq(&self, other: &$rhs) -> bool { <Path as PartialEq>::eq(self, other.as_ref()) }
1939:             fn eq(&self, other: &$lhs) -> bool { <Path as PartialEq>::eq(self.as_ref(), other) }
1945:                 <Path as PartialOrd>::partial_cmp(self, other.as_ref())
1952:                 <Path as PartialOrd>::partial_cmp(self.as_ref(), other)
1962: impl_cmp_os_str!(Path, OsStr);
1963: impl_cmp_os_str!(Path, &'a OsStr);
1964: impl_cmp_os_str!(Path, Cow<'a, OsStr>);
1965: impl_cmp_os_str!(Path, OsString);
1966: impl_cmp_os_str!(&'a Path, OsStr);
1967: impl_cmp_os_str!(&'a Path, Cow<'b, OsStr>);
1968: impl_cmp_os_str!(&'a Path, OsString);
1969: impl_cmp_os_str!(Cow<'a, Path>, OsStr);
1970: impl_cmp_os_str!(Cow<'a, Path>, &'b OsStr);
1971: impl_cmp_os_str!(Cow<'a, Path>, OsString);
32: //! and [`str`]), for working with paths abstractly. These types are thin wrappers
36: //! Paths can be parsed into [`Component`]s by iterating over the structure
40: //! [`PathBuf`]; note that the paths may differ syntactically by the
840: /// [`push`]: struct.PathBuf.html#method.push
841: /// [`set_extension`]: struct.PathBuf.html#method.set_extension
854:         unsafe { &mut *(self as *mut PathBuf as *mut Vec<u8>) }
857:     /// Allocates an empty `PathBuf`.
859:     pub fn new() -> PathBuf {
860:         PathBuf { inner: OsString::new() }
863:     /// Creates a new `PathBuf` with a given capacity used to create the
866:     pub fn with_capacity(capacity: usize) -> PathBuf {
867:         PathBuf {
930:     /// [`self.parent`]: struct.PathBuf.html#method.parent
952:     /// [`self.file_name`]: struct.PathBuf.html#method.file_name
954:     /// [`pop`]: struct.PathBuf.html#method.pop
976:     /// [`self.file_name`]: struct.PathBuf.html#method.file_name
977:     /// [`self.extension`]: struct.PathBuf.html#method.extension
1003:     /// Consumes the `PathBuf`, yielding its internal [`OsString`] storage.
1104:     fn from(s: &T) -> PathBuf {
1105:         PathBuf::from(s.as_ref().to_os_string())
1110:     /// Converts a `OsString` into a `PathBuf`
1113:     fn from(s: OsString) -> PathBuf {
1114:         PathBuf { inner: s }
1118: impl From<PathBuf> for OsString {
1119:     /// Converts a `PathBuf` into a `OsString`
1128:     /// Converts a `String` into a `PathBuf`
1131:     fn from(s: String) -> PathBuf {
1132:         PathBuf::from(OsString::from(s))
1140:         Ok(PathBuf::from(s))
1145:     fn from_iter<I: IntoIterator<Item = P>>(iter: I) -> PathBuf {
1146:         let mut buf = PathBuf::new();
1180:         PathBuf::new()
1249:     type Owned = PathBuf;
1250:     fn to_owned(&self) -> PathBuf {
1253:     fn clone_into(&self, target: &mut PathBuf) {
1259:     fn eq(&self, other: &PathBuf) -> bool {
1273:     fn partial_cmp(&self, other: &PathBuf) -> Option<cmp::Ordering> {
1279:     fn cmp(&self, other: &PathBuf) -> cmp::Ordering {
1299: /// see [`PathBuf`].
1303: /// [`PathBuf`]: struct.PathBuf.html
1374:     /// [`PathBuf`]: struct.PathBuf.html
1378:         PathBuf::from(self.inner.to_os_string())
1556:     /// [`PathBuf`]: struct.PathBuf.html
1557:     /// [`PathBuf::push`]: struct.PathBuf.html#method.push
1569:     /// Creates an owned [`PathBuf`] like `self` but with the given file name.
1571:     /// See [`PathBuf::set_file_name`] for more details.
1573:     /// [`PathBuf`]: struct.PathBuf.html
1574:     /// [`PathBuf::set_file_name`]: struct.PathBuf.html#method.set_file_name
1576:     pub fn with_file_name<S: AsRef<OsStr>>(&self, file_name: S) -> PathBuf {
1580:     fn _with_file_name(&self, file_name: &OsStr) -> PathBuf {
1586:     /// Creates an owned [`PathBuf`] like `self` but with the given extension.
1588:     /// See [`PathBuf::set_extension`] for more details.
1590:     /// [`PathBuf`]: struct.PathBuf.html
1591:     /// [`PathBuf::set_extension`]: struct.PathBuf.html#method.set_extension
1593:     pub fn with_extension<S: AsRef<OsStr>>(&self, extension: S) -> PathBuf {
1597:     fn _with_extension(&self, extension: &OsStr) -> PathBuf {
1645:     /// Returns an object that implements [`Display`] for safely printing paths
1687:     pub fn canonicalize(&self) -> io::Result<PathBuf> {
1698:     pub fn read_link(&self) -> io::Result<PathBuf> {
1772:     /// [`PathBuf`]: struct.PathBuf.html
1776:         PathBuf { inner: OsString::from(inner) }
1792: /// Helper struct for safely printing paths with [`format!`] and `{}`.
1958: impl_cmp_os_str!(PathBuf, OsStr);
1959: impl_cmp_os_str!(PathBuf, &'a OsStr);
1960: impl_cmp_os_str!(PathBuf, Cow<'a, OsStr>);
1961: impl_cmp_os_str!(PathBuf, OsString);
github.com/apache/flex-sdk:frameworks/projects/spark/src/spark/primitives/Path.as: [ master, ]
64: public class Path extends FilledElement
82:     public function Path()
1196: class PathSegmentsCollection
1214: public function PathSegmentsCollection(value:String)
1540: public function generateGraphicsPath(graphicsPath:GraphicsPath,
1742: public function PathSegment(_x:Number = 0, _y:Number = 0)
39:  *  The Path class is a filled graphic element that draws a series of path segments.
40:  *  In vector graphics, a path is a series of points connected by straight or curved line segments. 
41:  *  Together the lines form an image. In Flex, you use the Path class to define a complex vector shape 
44:  *  <p>Typically, the first element of a path definition is a Move segment to specify the starting pen 
51:  *  point of the line. You can use multiple Move segments in the path definition to 
54:  *  <p>The syntax used by the Path class to define the shape is the same as the SVG path syntax, 
94:      *  Dirty flag to indicate when path data has changed. 
105:      *  path segment information  
116:      *  commands to draw this Path.  
118:      *  The data commands expressed in a Path's <code>data</code> 
140:      *  A string containing a compact represention of the path segments. This is an alternate
144:      *  <p>The value is a space-delimited string describing each path segment. Each
198:      *      <td>Close path</td>
201:      *      <td>Closes off the path.</td>
245:      *  Fill rule for intersecting or overlapping path segments. 
322:      *  Returns the bounding box for the path including stroke, if the path is resized
406:      *  @return Returns the axis aligned bounding box of the path when
420:         // then the non-stroked path bounds for the give size can be
556:         // slow code-path Player execution for all graphics in that DisplayObject.
708:      *  if the path is resized to the specified size.
947:         // Resize transformed path with the iterative solution
962:         // the path size as the size changes the angles of the joints.
1193:  *  Path segments.
1452:  *  A Vector of the actual path segments. May be empty, but always non-null. 
1510:     // If path is empty, it's untransformed bounding box is (0,0), so we return transformed point (0,0)
1522:  *  array and draws each path egment based on its control points. 
1524:  *  Segments are drawn from the x and y position of the path. 
1526:  *  applied to the path. 
1529:  *  path segment should be drawn
1532:  *  path segment should be drawn
1535:  *  this path segment 
1538:  *  path segment
1550:     // the path will begin at the previous pen location
1712:  *  The PathSegment class is the base class for a segment of a path.
1794:  *  Draws this path segment. You can determine the current pen position by 
1817:  *  path segment.
24: import flash.display.GraphicsPath;
55:  *  which makes it easy to convert SVG paths to Flex paths.</p>
112:     private var segments:PathSegmentsCollection;
115:      *  A GraphicsPath object that contains the drawing 
123:     mx_internal var graphicsPath:GraphicsPath = new GraphicsPath(new Vector.<int>(), new Vector.<Number>());
218:         segments = new PathSegmentsCollection(value);
392:     private function tangentIsValid(prevSegment:PathSegment, curSegment:PathSegment,
418:         var pathBBox:Rectangle;
424:             pathBBox = new Rectangle(naturalBounds.x * sx,
429:                 pathBBox.offset(m.tx, m.ty);
433:             pathBBox = this.segments.getBoundingBox(width, height, m);
439:             return pathBBox;
441:         // Always add half the stroke weight, even for miter limit paths,
445:         pathBBox.inflate(strokeExtents.right, strokeExtents.bottom);
447:         var seg:Vector.<PathSegment> = segments.data;
453:             return pathBBox;
473:                 var prevSegment:PathSegment = start > 0 ? seg[start - 1] : null;
482:             var startSegment:PathSegment = seg[start];
519:             var endSegment:PathSegment = seg[end];
531:                     pathBBox);
538:         return pathBBox;
582:     private function addMiterLimitStrokeToBounds(segment0:PathSegment,
583:                                                  segment1:PathSegment,
584:                                                  segment2:PathSegment,
939:         // We have special handling for miter-limit stroked non-transformed paths,
1098:                 segments.generateGraphicsPath(graphicsPath, drawX, drawY, sx, sy);
1102:         g.drawPath(graphicsPath.commands, graphicsPath.data, winding);
1187: //  Internal Helper Class - PathSegmentsCollection
1194:  *  Provides methods for generating GraphicsPath and calculating bounds. 
1218:         _segments = new Vector.<PathSegment>();
1222:     var newSegments:Vector.<PathSegment> = new Vector.<PathSegment>();
1418:                 _segments = new Vector.<PathSegment>();
1449: private var _segments:Vector.<PathSegment>;
1454: public function get data():Vector.<PathSegment>
1499:     var prevSegment:PathSegment;
1500:     var pathBBox:Rectangle;
1505:         var segment:PathSegment = _segments[i];
1506:         pathBBox = segment.getBoundingBox(prevSegment, sx, sy, m, pathBBox);
1511:     if (!pathBBox)
1515:         pathBBox = new Rectangle(x, y);
1517:     return pathBBox;
1546:     graphicsPath.commands = null;
1547:     graphicsPath.data = null;
1552:     graphicsPath.moveTo(tx, ty);
1554:     var curSegment:PathSegment;
1555:     var prevSegment:PathSegment;
1561:         curSegment.draw(graphicsPath, tx, ty, sx, sy, prevSegment);
1702: //  Internal Helper Class - PathSegment 
1705: import flash.display.GraphicsPath;
1721: class PathSegment extends Object
1805: public function draw(graphicsPath:GraphicsPath, dx:Number,dy:Number,sx:Number,sy:Number,prev:PathSegment):void
1824: public function getBoundingBox(prev:PathSegment, sx:Number, sy:Number, m:Matrix, rect:Rectangle):Rectangle
1839: public function getTangent(prev:PathSegment, start:Boolean, sx:Number, sy:Number, m:Matrix, result:Point):void
1853: import flash.display.GraphicsPath;
1869: class LineSegment extends PathSegment
1911: override public function draw(graphicsPath:GraphicsPath, dx:Number,dy:Number,sx:Number,sy:Number,prev:PathSegment):void
1913:     graphicsPath.lineTo(dx + x*sx, dy + y*sy);
1924: override public function getBoundingBox(prev:PathSegment, sx:Number, sy:Number, m:Matrix, rect:Rectangle):Rectangle
1952: override public function getTangent(prev:PathSegment, start:Boolean, sx:Number, sy:Number, m:Matrix, result:Point):void
1967: import flash.display.GraphicsPath;
1981: class MoveSegment extends PathSegment
2024: override public function draw(graphicsPath:GraphicsPath, dx:Number,dy:Number,sx:Number,sy:Number,prev:PathSegment):void
2026:     graphicsPath.moveTo(dx+x*sx, dy+y*sy);
2036: import flash.display.GraphicsPath;
2061: class CubicBezierSegment extends PathSegment
2198:     override public function draw(graphicsPath:GraphicsPath, dx:Number, dy:Number, sx:Number, sy:Number, prev:PathSegment):void
2202:         graphicsPath.curveTo(dx + qPts.control1.x*sx, dy+qPts.control1.y*sy, dx+qPts.anchor1.x*sx, dy+qPts.anchor1.y*sy)...(1 bytes skipped)...
2203:         graphicsPath.curveTo(dx + qPts.control2.x*sx, dy+qPts.control2.y*sy, dx+qPts.anchor2.x*sx, dy+qPts.anchor2.y*sy)...(1 bytes skipped)...
2204:         graphicsPath.curveTo(dx + qPts.control3.x*sx, dy+qPts.control3.y*sy, dx+qPts.anchor3.x*sx, dy+qPts.anchor3.y*sy)...(1 bytes skipped)...
2205:         graphicsPath.curveTo(dx + qPts.control4.x*sx, dy+qPts.control4.y*sy, dx+qPts.anchor4.x*sx, dy+qPts.anchor4.y*sy)...(1 bytes skipped)...
2216:     override public function getBoundingBox(prev:PathSegment, sx:Number, sy:Number,
2252:     override public function getTangent(prev:PathSegment, start:Boolean, sx:Number, sy:Number, m:Matrix, result:Point):void
2318:     private function getQuadraticPoints(prev:PathSegment):QuadraticPoints
2411: import flash.display.GraphicsPath;
2431: class QuadraticBezierSegment extends PathSegment
2526:     override public function draw(graphicsPath:GraphicsPath, dx:Number,dy:Number,sx:Number,sy:Number,prev:PathSegment):void
2528:         graphicsPath.curveTo(dx+control1X*sx, dy+control1Y*sy, dx+x*sx, dy+y*sy);
2574:     override public function getTangent(prev:PathSegment, start:Boolean, sx:Number, sy:Number, m:Matrix, result:Point):void
2591:     override public function getBoundingBox(prev:PathSegment, sx:Number, sy:Number,
101:     private var graphicsPathChanged:Boolean = true;
220:         graphicsPathChanged = true;
246:      *  Possible values are <code>GraphicsPathWinding.EVEN_ODD</code> or <code>GraphicsPathWinding.NON_ZERO</code>.
250:      *  @see flash.display.GraphicsPathWinding 
262:             graphicsPathChanged = true;
1085:             graphicsPathChanged = true;
1092:         if (graphicsPathChanged)
1099:             graphicsPathChanged = false;
1139:         graphicsPathChanged = true;
github.com/GNOME/librsvg:rsvg_internals/src/path_builder.rs: [ mainline, ]
456: pub struct Path {
547: impl Path {
440:     path_commands: TinyVec<[PathCommand; 32]>,
482:     pub fn into_path(self) -> Path {
542:     pub fn close_path(&mut self) {
331: pub enum PathCommand {
336:     ClosePath,
339: impl Default for PathCommand {
345: impl PathCommand {
439: pub struct PathBuilder {
472:     ClosePath,
475: impl PathBuilder {
27:     /// The (x, y) coordinates of the end point of this path segment.
88:     /// The (x, y) coordinates for the start point of this path segment.
90:     /// The (x, y) coordinates for the end point of this path segment.
352:             PathCommand::ClosePath => cr.close_path(),
356:     // Returns the number of coordinate values that this command will generate in a `Path`.
434: /// Constructs a path out of commands.
436: /// When you are finished constructing a path builder, turn it into
437: /// a `Path` with `into_path`.
443: /// An immutable path with a compact representation.
446: /// can get an iterator for the path's commands with the `iter`
461: /// Packed version of a `PathCommand`, used in `Path`.
478:             path_commands: TinyVec::new(),
484:             .path_commands
491:             .path_commands
496:         Path {
503:         self.path_commands.push(PathCommand::MoveTo(x, y));
507:         self.path_commands.push(PathCommand::LineTo(x, y));
516:         self.path_commands.push(PathCommand::CurveTo(curve));
539:         self.path_commands.push(PathCommand::Arc(arc));
543:         self.path_commands.push(PathCommand::ClosePath);
566:         // We check the cr's status right after feeding it a new path for a few reasons:
568:         // * Any of the individual path commands may cause the cr to enter an error state, for
599:         let path = builder.into_path();
600:         assert!(path.is_empty());
601:         assert_eq!(path.iter().count(), 0);
621:         builder.close_path();
622:         let path = builder.into_path();
623:         assert!(path.iter().eq(vec![
1: //! Representation of B├ęzier paths.
341:         PathCommand::CurveTo(CubicBezierCurve::default())
348:             PathCommand::MoveTo(x, y) => cr.move_to(x, y),
349:             PathCommand::LineTo(x, y) => cr.line_to(x, y),
350:             PathCommand::CurveTo(curve) => curve.to_cairo(cr),
351:             PathCommand::Arc(arc) => arc.to_cairo(cr),
359:             PathCommand::MoveTo(..) => 2,
360:             PathCommand::LineTo(..) => 2,
361:             PathCommand::CurveTo(_) => 6,
362:             PathCommand::Arc(_) => 7,
363:             PathCommand::ClosePath => 0,
369:             PathCommand::MoveTo(x, y) => {
375:             PathCommand::LineTo(x, y) => {
381:             PathCommand::CurveTo(ref c) => c.to_packed_and_coords(coords),
383:             PathCommand::Arc(ref a) => a.to_packed_and_coords(coords),
385:             PathCommand::ClosePath => PackedCommand::ClosePath,
389:     fn from_packed<'a>(packed: PackedCommand, coords: &mut slice::Iter<'a, f64>) -> PathCommand {
394:                 PathCommand::MoveTo(x, y)
400:                 PathCommand::LineTo(x, y)
403:             PackedCommand::CurveTo => PathCommand::CurveTo(CubicBezierCurve::from_coords(coords)),
405:             PackedCommand::ClosePath => PathCommand::ClosePath,
407:             PackedCommand::ArcSmallNegative => PathCommand::Arc(EllipticalArc::from_coords(
413:             PackedCommand::ArcSmallPositive => PathCommand::Arc(EllipticalArc::from_coords(
419:             PackedCommand::ArcLargeNegative => PathCommand::Arc(EllipticalArc::from_coords(
425:             PackedCommand::ArcLargePositive => PathCommand::Arc(EllipticalArc::from_coords(
445: /// This is constructed from a `PathBuilder` once it is finished.  You
449: /// Most `PathCommand` variants only have a few coordinates, but `PathCommand::Arc`
454: /// Each `PathCommand` knows how many coordinates it ought to produce, with
476:     pub fn new() -> PathBuilder {
477:         PathBuilder {
486:             .map(PathCommand::num_coordinates)
548:     pub fn iter<'a>(&'a self) -> impl Iterator<Item = PathCommand> + 'a {
552:         commands.map(move |cmd| PathCommand::from_packed(*cmd, &mut coords))
598:         let builder = PathBuilder::new();
606:         let mut builder = PathBuilder::new();
624:             PathCommand::MoveTo(42.0, 43.0),
625:             PathCommand::LineTo(42.0, 43.0),
626:             PathCommand::CurveTo(CubicBezierCurve {
631:             PathCommand::Arc(EllipticalArc {
639:             PathCommand::ClosePath,
github.com/GNOME/gimp:tools/gimppath2svg.py: [ mainline, ]
43: class Path:
114: path = Path()
30: <path id="%s" transform="translate (%d,%d)"
55:             path.name = namematch.group(1)
59:                path.gimppoints.append ([])
61:             path.gimppoints[-1].append (map (int, pointmatch.groups()))
71:       for path in self.gimppoints:
72:          if path:
73:             start = path[0]
75:             path = path[1:]
76:             while path:
77:                curve = path [0:3]
78:                path = path[3:]
115: path.readgimpfile (infile)
116: path.makesvg()
117: path.writesvgfile (outfile)
6: gimppath2svg.py -- Converts Gimp-Paths to a SVG-File.
23: Usage: gimppath2svg.py [infile [outfile]]
46:       self.svgpath = ""
89:             self.svgpath = self.svgpath + svg
92:       if self.svgpath:
97:                               self.svgpath)
android.googlesource.com/platform/external/python/parse_type:tasks/_vendor/path.py: [ master, ]
176: class Path(text_type):
1717: class path(Path):
294:     def abspath(self):
302:     def normpath(self):
306:     def realpath(self):
383:     def splitpath(self):
441:     def joinpath(cls, first, *others):
475:     def relpath(self, start='.'):
1141:         def pathconf(self, name):
482:     def relpathto(self, dest):
2: # SOURCE: https://pypi.python.org/pypi/path.py
27: path.py - An object representing a path to a file or directory.
29: https://github.com/jaraco/path.py
33:     from path import Path
34:     d = Path('/home/guido/bin')
113: __all__ = ['Path', 'CaseInsensitivePattern']
126:     __version__ = pkg_resources.require('path.py')[0].version
143:     Save results for the :meth:'path.using_module' classmethod.
178:     Represents a filesystem path.
181:     counterparts in :mod:`os.path`.
185:     such that they will be bound to the Path instance. For example,
186:     ``Path(src).copy(target)`` is equivalent to
189:     the Path instance.
192:     module = os.path
193:     """ The path module to use for path operations.
195:     .. seealso:: :mod:`os.path`
200:             raise TypeError("Invalid initial value for path: None")
221:     def _always_unicode(cls, path):
223:         Ensure the path as retrieved from a Python API, such as :func:`os.listdir`,
226:         if PY3 or isinstance(path, text_type):
227:             return path
228:         return path.decode(sys.getfilesystemencoding(), 'surrogateescape')
233:         return '%s(%s)' % (type(self).__name__, super(Path, self).__repr__())
235:     # Adding a Path and a string yields a Path.
238:             return self._next_class(super(Path, self).__add__(more))
251:         Join two path components, adding a separator character if
254:         .. seealso:: :func:`os.path.join`
265:         Join two path components, adding a separator character if
268:         .. seealso:: :func:`os.path.join`
285:         """ Return the current working directory as a path object.
292:     # --- Operations on Path strings.
295:         """ .. seealso:: :func:`os.path.abspath` """
299:         """ .. seealso:: :func:`os.path.normcase` """
303:         """ .. seealso:: :func:`os.path.normpath` """
307:         """ .. seealso:: :func:`os.path.realpath` """
311:         """ .. seealso:: :func:`os.path.expanduser` """
315:         """ .. seealso:: :func:`os.path.expandvars` """
319:         """ .. seealso:: :attr:`parent`, :func:`os.path.dirname` """
323:         """ .. seealso:: :attr:`name`, :func:`os.path.basename` """
340:         ``Path('/home/guido/python.tar.gz').name == 'python.tar.gz'``,
342:         ``Path('/home/guido/python.tar.gz').namebase == 'python.tar'``.
364:         """ This path's parent directory, as a new Path object.
367:         ``Path('/usr/local/lib/libpython.so').parent ==
368:         Path('/usr/local/lib')``
370:         .. seealso:: :meth:`dirname`, :func:`os.path.dirname`
375:         """ The name of this file or directory without the full path.
378:         ``Path('/usr/local/lib/libpython.so').name == 'libpython.so'``
380:         .. seealso:: :meth:`basename`, :func:`os.path.basename`
386:         .. seealso:: :attr:`parent`, :attr:`name`, :func:`os.path.split`
394:         Split the drive specifier from this path.  If there is
396:         is simply ``(Path(''), p)``.  This is always the case on Unix.
398:         .. seealso:: :func:`os.path.splitdrive`
406:         Split the filename extension from this path and return
410:         last path segment.  This has the property that if
413:         .. seealso:: :func:`os.path.splitext`
419:         """ p.stripext() -> Remove one file extension from the path.
421:         For example, ``Path('/home/guido/python.tar.gz').stripext()``
422:         returns ``Path('/home/guido/python.tar')``.
427:         """ .. seealso:: :func:`os.path.splitunc` """
434:         The UNC mount point for this path.
443:         Join first to zero or more :class:`Path` components, adding a separator
447:         .. seealso:: :func:`os.path.join`
454:         r""" Return a list of the path components in this path.
456:         The first item in the list will be a Path.  Its value will be
458:         directory of this path (for example, ``'/'`` or ``'C:\\'``).  The
461:         ``path.Path.joinpath(*result)`` will yield the original path.
476:         """ Return this path as a relative path,
483:         """ Return a relative path from `self` to `dest`.
485:         If there is no relative path from `self` to `dest`, for example if
528:         The elements of the list are Path objects.
546:         The elements of the list are Path objects.
559:         The elements of the list are Path objects.
572:         The iterator yields Path objects naming each child item of
713:             attribute, it is applied to the name and path prior to comparison.
717:             to :meth:`os.path.normcase`.
728:         """ Return a list of Path objects that match the pattern.
730:         `pattern` - a path relative to this directory, with wildcards.
732:         For example, ``Path('/users').glob('*/bin/*')`` returns a list
766:                >>> for chunk in Path("path.py").chunks(8192, mode='rb'):
902:         By default this overwrites any existing file at this path.
956:         """ Returns a hash object for the file at the current path.
987:     # N.B. On some platforms, the os.path functions may be implemented in C
992:         """ .. seealso:: :func:`os.path.isabs` """
996:         """ .. seealso:: :func:`os.path.exists` """
1000:         """ .. seealso:: :func:`os.path.isdir` """
1004:         """ .. seealso:: :func:`os.path.isfile` """
1008:         """ .. seealso:: :func:`os.path.islink` """
1012:         """ .. seealso:: :func:`os.path.ismount` """
1016:         """ .. seealso:: :func:`os.path.samefile` """
1018:             other = Path(other).realpath().normpath().normcase()
1023:         """ .. seealso:: :attr:`atime`, :func:`os.path.getatime` """
1030:         .. seealso:: :meth:`getatime`, :func:`os.path.getatime`
1034:         """ .. seealso:: :attr:`mtime`, :func:`os.path.getmtime` """
1041:         .. seealso:: :meth:`getmtime`, :func:`os.path.getmtime`
1045:         """ .. seealso:: :attr:`ctime`, :func:`os.path.getctime` """
1052:         .. seealso:: :meth:`getctime`, :func:`os.path.getctime`
1056:         """ .. seealso:: :attr:`size`, :func:`os.path.getsize` """
1063:         .. seealso:: :meth:`getsize`, :func:`os.path.getsize`
1068:             """ Return ``True`` if current user has access to this path.
1078:         """ Perform a ``stat()`` system call on this path.
1134:             """ Perform a ``statvfs()`` system call on this path.
1322:             """ Return the path to which this symbolic link points.
1324:             The result may be an absolute or a relative path.
1331:             """ Return the path to which this symbolic link points.
1333:             The result is always an absolute path.
1345:     # Path(name).copy(target) will invoke shutil.copy(name, target)
1432:             p = Path(filename)
1506:             dir = Path.special().user.config
1514:             dir = Path.special("My App").user.config.makedirs_p()
1531:     def __init__(self, path_class, *args, **kwargs):
1539:             path_class=path_class,
1549:         result wrapped in self.path_class
1553:         MultiPath = Multi.for_class(self.path_class)
1559:     A mix-in for a Path which may contain multiple Path separated by pathsep.
1562:     def for_class(cls, path_cls):
1563:         name = 'Multi' + path_cls.__name__
1566:         return type(name, (cls, path_cls), {})
1590: class tempdir(Path):
1598:             # do stuff with the Path object "d"
1608:         return Path
1707:         from path import Path, CaseInsensitivePattern as ci
1708:         Path('.').files(ci('*.py'))
1719:         msg = "path is deprecated. Use Path instead."
1721:         return Path.__new__(cls, *args, **kwargs)
1724: __all__ += ['path']
247:     # The / operator joins Paths.
249:         """ fp.__div__(rel) == fp / rel == fp.joinpath(rel)
261:     # The / operator joins Paths the other way around
296:         return self._next_class(self.module.abspath(self))
304:         return self._next_class(self.module.normpath(self))
308:         return self._next_class(self.module.realpath(self))
328:         :meth:`expanduser()`, and :meth:`normpath()` on it.
333:         return self.expandvars().expanduser().normpath()
384:         """ p.splitpath() -> Return ``(p.parent, p.name)``.
435:         This is empty for paths on local drives.
467:             loc, child = prev.splitpath()
487:         ``dest.abspath()``.
489:         origin = self.abspath()
490:         dest = self._next_class(dest).abspath()
500:         # Find the location where the two paths start to differ.
507:         # Now i is the point where the two paths diverge.
515:             relpath = os.curdir
517:             relpath = self.module.join(*segments)
518:         return self._next_class(relpath)
1019:             return self.realpath().normpath().normcase() == other
1140:     if hasattr(os, 'pathconf'):
1142:             """ .. seealso:: :func:`os.pathconf` """
1143:             return os.pathconf(self, name)
1303:         def link(self, newpath):
1304:             """ Create a hard link at `newpath`, pointing to this file.
1308:             os.link(self, newpath)
1309:             return self._next_class(newpath)
1341:                 return (self.parent / p).abspath()
1510:         the paths in a platform-friendly way.
1524:         def __init__(self, paths, scope):
1525:             self.paths = paths
1529:             return self.paths.get_dir(self.scope, class_)
1554:         return MultiPath.detect(value)
1570:         if os.pathsep not in input:
1575:         return iter(map(self._next_class, self.split(os.pathsep)))
1713:         return __import__('ntpath').normcase
480:         return cwd.relpathto(self)
github.com/google/go-cmp:cmp/path.go: [ master, ]
26: type Path []PathStep
34: type PathStep interface {
151: type pathStep struct {
172: 	pathStep
211: 	pathStep
256: 	pathStep
270: 	pathStep
280: 	pathStep
290: 	pathStep
335: type pointerPath struct {
17: // Path is a list of PathSteps describing the sequence of operations to get
19: // The first Path element is always an operation-less PathStep that exists
37: 	// Type is the resulting type after performing the path step.
40: 	// Values is the resulting values after performing the path step.
65: func (pa *Path) push(s PathStep) {
69: func (pa *Path) pop() {
73: // Last returns the last PathStep in the Path.
74: // If the path is empty, this returns a non-nil PathStep that reports a nil Type.
75: func (pa Path) Last() PathStep {
79: // Index returns the ith step in the Path and supports negative indexing.
80: // A negative index starts counting from the tail of the Path such that -1
83: func (pa Path) Index(i int) PathStep {
93: // String returns the simplified path to a node.
94: // The simplified path only contains struct field accesses.
98: func (pa Path) String() string {
108: // GoString returns the path to a specific node using Go syntax.
112: func (pa Path) GoString() string {
329: // Path for whether px was ever encountered in the Path history of x, and
334: // in O(1) instead of O(N) where N is len(Path).
28: // PathStep is a union-type for specific operations to traverse
57: 	_ PathStep = StructField{}
58: 	_ PathStep = SliceIndex{}
59: 	_ PathStep = MapIndex{}
60: 	_ PathStep = Indirect{}
61: 	_ PathStep = TypeAssertion{}
62: 	_ PathStep = Transform{}
82: // If index is invalid, this returns a non-nil PathStep that reports a nil Type.
88: 		return pathStep{}
116: 		var nextStep PathStep
156: func (ps pathStep) Type() reflect.Type             { return ps.typ }
157: func (ps pathStep) Values() (vx, vy reflect.Value) { return ps.vx, ps.vy }
158: func (ps pathStep) String() string {
308: // pointerPath represents a dual-stack of pointers encountered when
313: // The pointerPath uses a map to represent a stack; where descension into a
331: // equal if both px and py have a cycle resulting from the same PathStep.
342: func (p *pointerPath) Init() {
354: func (p pointerPath) Push(vx, vy reflect.Value) (equal, visited bool) {
369: func (p pointerPath) Pop(vx, vy reflect.Value) {
chromium.googlesource.com/infra/third_party/virtualenv:src/virtualenv/util/path/_pathlib/via_os_path.py: [ master, ]
12: class Path(object):
13:     def __init__(self, path):
14:         if isinstance(path, Path):
15:             _path = path._path
17:             _path = ensure_text(path)
19:                 _path = _path.encode("utf-8")
20:         self._path = _path
23:         return ensure_str("Path({})".format(ensure_text(self._path)))
26:         return ensure_text(self._path)
29:         return ensure_str(self._path)
32:         if isinstance(other, Path):
33:             right = other._path
38:         return Path(os.path.join(self._path, right))
44:         return self._path == (other._path if isinstance(other, Path) else None)
50:         return hash(self._path)
53:         return os.path.exists(self._path)
57:         return Path(os.path.abspath(os.path.join(self._path, os.path.pardir)))
60:         return Path(os.path.realpath(self._path))
64:         return os.path.basename(self._path)
68:         return self._path.split(os.sep)
71:         return os.path.isfile(self._path)
74:         return os.path.isdir(self._path)
78:             os.makedirs(self._path)
84:         with open(self._path, "rb") as file_handler:
88:         with open(self._path, "wb") as file_handler:
92:         for p in os.listdir(self._path):
93:             yield Path(os.path.join(self._path, p))
97:         _, ext = os.path.splitext(self.name)
102:         base, _ = os.path.splitext(self.name)
107:         with open(self._path, mode) as file_handler:
115:             result.append(Path(os.sep.join(parts[0 : i + 1])))
119:         os.remove(self._path)
125:         return os.path.islink(self._path)
128:         if not self._path.startswith(other._path):
129:             raise ValueError("{} does not start with {}".format(self._path, other._path))
130:         return Path(os.sep.join(self.parts[len(other.parts) :]))
133:         return os.stat(self._path)
136:         os.chmod(self._path, mode)
139: __all__ = ("Path",)
android.googlesource.com/platform/build/soong:android/paths.go: [ master, ]
114: type Path interface {
186: 	path  Path
679: 	path   string
204: func (p OptionalPath) Path() Path {
34: type PathContext interface {
39: type PathGlobContext interface {
105: func pathContextName(ctx PathContext, module blueprint.Module) string {
131: type WritablePath interface {
139: 	writablePath()
184: type OptionalPath struct {
190: func OptionalPathForPath(path Path) OptionalPath {
221: type Paths []Path
224: func PathsForSource(ctx PathContext, paths []string) Paths {
252: func PathsForModuleSrc(ctx ModuleContext, paths []string) Paths {
263: func PathsForModuleSrcExcludes(ctx ModuleContext, paths, excludes []string) Paths {
310: func PathsAndMissingDepsForModuleSrcExcludes(ctx ModuleContext, paths, excludes []string) (Paths, []string) {
373: func expandOneSrcPath(ctx ModuleContext, s string, expandedExcludes []string) (Paths, error) {
425: func pathsForModuleSrcFromFullPath(ctx EarlyModuleContext, paths []string, incDirs bool) Paths {
456: func PathsWithOptionalDefaultForModuleSrc(ctx ModuleContext, input []string, def string) Paths {
624: func PathsToDirectorySortedPaths(paths Paths) DirectorySortedPaths {
634: func (p DirectorySortedPaths) PathsInDirectory(dir string) Paths {
678: type basePath struct {
710: type SourcePath struct {
711: 	basePath
739: func pathForSource(ctx PathContext, pathComponents ...string) (SourcePath, error) {
781: func PathForSource(ctx PathContext, pathComponents ...string) SourcePath {
858: func (p SourcePath) OverlayPath(ctx ModuleContext, path Path) OptionalPath {
884: type OutputPath struct {
885: 	basePath
886: 	fullPath string
910: func PathForOutput(ctx PathContext, pathComponents ...string) OutputPath {
921: func PathsForOutput(ctx PathContext, paths []string) WritablePaths {
929: func (p OutputPath) writablePath() {}
969: func PathForIntermediates(ctx PathContext, paths ...string) OutputPath {
983: func PathForModuleSrc(ctx ModuleContext, pathComponents ...string) Path {
1009: func pathForModuleSrc(ctx ModuleContext, paths ...string) SourcePath {
1028: func PathsWithModuleSrcSubDir(ctx ModuleContext, paths Paths, subDir string) Paths {
1040: func PathWithModuleSrcSubDir(ctx ModuleContext, path Path, subDir string) Path {
1069: type ModuleOutPath struct {
1070: 	OutputPath
1079: func pathForModule(ctx ModuleContext) OutputPath {
1085: func PathForVndkRefAbiDump(ctx ModuleContext, version, fileName string,
1123: func PathForModuleOut(ctx ModuleContext, paths ...string) ModuleOutPath {
1135: type ModuleGenPath struct {
1136: 	ModuleOutPath
1145: func PathForModuleGen(ctx ModuleContext, paths ...string) ModuleGenPath {
1168: type ModuleObjPath struct {
1169: 	ModuleOutPath
1176: func PathForModuleObj(ctx ModuleContext, pathComponents ...string) ModuleObjPath {
1186: type ModuleResPath struct {
1187: 	ModuleOutPath
1194: func PathForModuleRes(ctx ModuleContext, pathComponents ...string) ModuleResPath {
1204: type InstallPath struct {
1205: 	basePath
1217: func (p InstallPath) writablePath() {}
1240: func (p InstallPath) ToMakePath() InstallPath {
1247: func PathForModuleInstall(ctx ModuleInstallPathContext, pathComponents ...string) InstallPath {
1263: func pathForInstall(ctx PathContext, os OsType, partition string, debug bool,
1296: func pathForNdkOrSdkInstall(ctx PathContext, prefix string, paths []string) InstallPath {
1305: func PathForNdkInstall(ctx PathContext, paths ...string) InstallPath {
1309: func PathForMainlineSdksInstall(ctx PathContext, paths ...string) InstallPath {
1313: func InstallPathToOnDevicePath(ctx PathContext, path InstallPath) string {
1391: func validateSafePath(pathComponents ...string) (string, error) {
1407: func validatePath(pathComponents ...string) (string, error) {
1416: func PathForPhony(ctx PathContext, phony string) WritablePath {
1423: type PhonyPath struct {
1424: 	basePath
1427: func (p PhonyPath) writablePath() {}
1436: type testPath struct {
1437: 	basePath
1446: func PathForTesting(paths ...string) Path {
1455: func PathsForTesting(strs ...string) Paths {
1473: func PathContextForTesting(config Config) PathContext {
1520: func absolutePath(path string) string {
279: func (p OutputPaths) Paths() Paths {
667: func (p WritablePaths) Paths() Paths {
1366: func (p InstallPaths) Paths() Paths {
47: type NullPathContext struct {
54: type ModuleInstallPathContext interface {
88: func reportPathError(ctx PathContext, err error) {
95: func reportPathErrorf(ctx PathContext, format string, args ...interface{}) {
142: type genPathProvider interface {
143: 	genPathWithExt(ctx ModuleContext, subdir, ext string) ModuleGenPath
145: type objPathProvider interface {
146: 	objPathWithExt(ctx ModuleContext, subdir, ext string) ModuleObjPath
148: type resPathProvider interface {
149: 	resPathWithName(ctx ModuleContext, name string) ModuleResPath
154: func GenPathWithExt(ctx ModuleContext, subdir string, p Path, ext string) ModuleGenPath {
164: func ObjPathWithExt(ctx ModuleContext, subdir string, p Path, ext string) ModuleObjPath {
175: func ResPathWithName(ctx ModuleContext, p Path, name string) ModuleResPath {
235: func ExistentPathsForSources(ctx PathContext, paths []string) Paths {
276: type OutputPaths []OutputPath
480: func FirstUniquePaths(list Paths) Paths {
489: func SortedUniquePaths(list Paths) Paths {
497: func firstUniquePathsList(list Paths) Paths {
512: func firstUniquePathsMap(list Paths) Paths {
528: func LastUniquePaths(list Paths) Paths {
545: func ReversePaths(list Paths) Paths {
556: func indexPathList(s Path, list []Path) int {
566: func inPathList(p Path, list []Path) bool {
570: func FilterPathList(list []Path, filter []Path) (remainder []Path, filtered []Path) {
574: func FilterPathListPredicate(list []Path, predicate func(Path) bool) (remainder []Path, filtered []Path) {
622: type DirectorySortedPaths Paths
652: type WritablePaths []WritablePath
723: func safePathForSource(ctx PathContext, pathComponents ...string) (SourcePath, error) {
810: func ExistentPathForSource(ctx PathContext, pathComponents ...string) OptionalPath {
1048: func OptionalPathForModuleSrc(ctx ModuleContext, p *string) OptionalPath {
1055: func (p SourcePath) genPathWithExt(ctx ModuleContext, subdir, ext string) ModuleGenPath {
1059: func (p SourcePath) objPathWithExt(ctx ModuleContext, subdir, ext string) ModuleObjPath {
1063: func (p SourcePath) resPathWithName(ctx ModuleContext, name string) ModuleResPath {
1075: func (p ModuleOutPath) objPathWithExt(ctx ModuleContext, subdir, ext string) ModuleObjPath {
1157: func (p ModuleGenPath) genPathWithExt(ctx ModuleContext, subdir, ext string) ModuleGenPath {
1162: func (p ModuleGenPath) objPathWithExt(ctx ModuleContext, subdir, ext string) ModuleObjPath {
1363: type InstallPaths []InstallPath
1464: type testPathContext struct {
21: 	"path/filepath"
33: // Path methods.
46: // "Null" path context is a minimal path context for a given config.
115: 	// Returns the path in string form
118: 	// Ext returns the extension of the last element of the path
121: 	// Base returns the last element of the path
124: 	// Rel returns the portion of the path relative to the directory it was created from.  For
125: 	// example, Rel on a PathsForModuleSrc would return the path relative to the module source
130: // WritablePath is a type of path that can be used as an output for build rules.
132: 	Path
134: 	// return the path to the build directory.
152: // GenPathWithExt derives a new file path in ctx's generated sources directory
153: // from the current path, but with the new extension.
155: 	if path, ok := p.(genPathProvider); ok {
156: 		return path.genPathWithExt(ctx, subdir, ext)
158: 	reportPathErrorf(ctx, "Tried to create generated file from unsupported path: %s(%s)", reflect.TypeOf(p).Name(), p)
162: // ObjPathWithExt derives a new file path in ctx's object directory from the
163: // current path, but with the new extension.
165: 	if path, ok := p.(objPathProvider); ok {
166: 		return path.objPathWithExt(ctx, subdir, ext)
168: 	reportPathErrorf(ctx, "Tried to create object file from unsupported path: %s (%s)", reflect.TypeOf(p).Name(), p)
172: // ResPathWithName derives a new path in ctx's output resource directory, using
173: // the current path to create the directory name, and the `name` argument for
176: 	if path, ok := p.(resPathProvider); ok {
177: 		return path.resPathWithName(ctx, name)
179: 	reportPathErrorf(ctx, "Tried to create res file from unsupported path: %s (%s)", reflect.TypeOf(p).Name(), p)
183: // OptionalPath is a container that may or may not contain a valid Path.
189: // OptionalPathForPath returns an OptionalPath containing the path.
191: 	if path == nil {
194: 	return OptionalPath{valid: true, path: path}
197: // Valid returns whether there is a valid path
202: // Path returns the Path embedded in this OptionalPath. You must be sure that
203: // there is a valid path, since this method will panic if there is not.
206: 		panic("Requesting an invalid path")
208: 	return p.path
211: // String returns the string version of the Path, or "" if it isn't valid.
214: 		return p.path.String()
220: // Paths is a slice of Path objects, with helpers to operate on the collection.
226: 	for i, path := range paths {
227: 		ret[i] = PathForSource(ctx, path)
237: 	for _, path := range paths {
238: 		p := ExistentPathForSource(ctx, path)
240: 			ret = append(ret, p.Path())
249: // `android:"path"` so that dependencies on SourceFileProducer modules will have already been handled by the
250: // path_properties mutator.  If ctx.Config().AllowMissingDependencies() is true then any missing SourceFile...(11 bytes skipped)...
259: // argument must have been annotated with struct tag `android:"path"` so that dependencies on SourceFileProducer modules
260: // will have already been handled by the path_properties mutator.  If ctx.Config().AllowMissingDependencies() is
269: 			ctx.ModuleErrorf(`missing dependency on %q, is the property annotated with android:"path"?`, m)
284: 	for i, path := range p {
285: 		ret[i] = path
296: 	for i, path := range p {
297: 		ret[i] = path.String()
306: // `android:"path"` so that dependencies on SourceFileProducer modules will have already been handled by the
307: // path_properties mutator.  If ctx.Config().AllowMissingDependencies() is true then any missing SourceFile...(11 bytes skipped)...
330: 					ctx.ModuleErrorf("path dependency %q: %s", e, err)
334: 				ctx.ModuleErrorf("path dependency %q is not an output file producing module", e)
338: 				ctx.ModuleErrorf("path dependency %q is not a source file producing module", e)
382: 				return nil, fmt.Errorf("path dependency %q: %s", s, err)
386: 			return nil, fmt.Errorf("path dependency %q is not an output file producing module", s)
399: 			return nil, fmt.Errorf("path dependency %q is not a source file producing module", s)
409: 			reportPathErrorf(ctx, "module source path %q does not exist", p)
435: 		path := filepath.Clean(p)
436: 		if !strings.HasPrefix(path, prefix) {
437: 			reportPathErrorf(ctx, "Path %q is not in module source directory %q", p, prefix)
441: 		srcPath, err := safePathForSource(ctx, ctx.ModuleDir(), path[len(prefix):])
447: 		srcPath.basePath.rel = srcPath.path
462: 	path := filepath.Join(ctx.Config().srcDir, ctx.ModuleDir(), def)
463: 	return ctx.Glob(path, nil)
472: 	for i, path := range p {
473: 		ret[i] = path.String()
514: 	seen := make(map[Path]bool, len(list))
571: 	return FilterPathListPredicate(list, func(p Path) bool { return inPathList(p, filter) })
588: 	for _, path := range p {
589: 		if path.Ext() == ext {
600: 	for _, path := range p {
601: 		if path.Ext() == ext {
602: 			ret = append(ret, path)
611: 	for _, path := range p {
612: 		if path.Ext() != ext {
613: 			ret = append(ret, path)
660: 	for i, path := range p {
661: 		ret[i] = path.String()
672: 	for i, path := range p {
673: 		ret[i] = path
685: 	return filepath.Ext(p.path)
689: 	return filepath.Base(p.path)
696: 	return p.path
700: 	return p.path
704: 	p.path = filepath.Join(p.path, rel)
709: // SourcePath is a Path representing a file path rooted from SrcDir
714: var _ Path = SourcePath{}
730: 	// absolute path already checked by validateSafePath
732: 		return ret, fmt.Errorf("source path %q is in output", ret.String())
746: 	// absolute path already checked by validatePath
748: 		return ret, fmt.Errorf("source path %q is in output", ret.String())
754: // existsWithDependencies returns true if the path exists, and adds appropriate dependencies to rerun if the
755: // path does not exist.
756: func existsWithDependencies(ctx PathContext, path SourcePath) (exists bool, err error) {
762: 		files, err = gctx.GlobWithDeps(path.String(), nil)
767: 		files, deps, err = ctx.Config().fs.Glob(path.String(), nil, pathtools.FollowSymlinks)
778: // PathForSource joins the provided path components and validates that the result
782: 	path, err := pathForSource(ctx, pathComponents...)
787: 	if pathtools.IsGlob(path.String()) {
788: 		reportPathErrorf(ctx, "path may not contain a glob: %s", path.String())
792: 		exists, err := existsWithDependencies(ctx, path)
797: 			modCtx.AddMissingDependencies([]string{path.String()})
799: 	} else if exists, _, err := ctx.Config().fs.Exists(path.String()); err != nil {
800: 		reportPathErrorf(ctx, "%s: %s", path, err.Error())
802: 		reportPathErrorf(ctx, "source path %q does not exist", path)
804: 	return path
808: // path exists, or an empty OptionalPath if it doesn't exist. Dependencies are added
809: // so that the ninja file will be regenerated if the state of the path changes.
811: 	path, err := pathForSource(ctx, pathComponents...)
817: 	if pathtools.IsGlob(path.String()) {
818: 		reportPathErrorf(ctx, "path may not contain a glob: %s", path.String())
822: 	exists, err := existsWithDependencies(ctx, path)
830: 	return OptionalPathForPath(path)
834: 	return filepath.Join(p.config.srcDir, p.path)
837: // Join creates a new SourcePath with paths... joined with the current path. The
838: // provided paths... may not use '..' to escape from the current path.
840: 	path, err := validatePath(paths...)
844: 	return p.withRel(path)
847: // join is like Join but does less path validation.
849: 	path, err := validateSafePath(paths...)
853: 	return p.withRel(path)
856: // OverlayPath returns the overlay for `path' if it exists. This assumes that the
857: // SourcePath is the path to a resource overlay directory.
860: 	if srcPath, ok := path.(SourcePath); ok {
861: 		relDir = srcPath.path
863: 		reportPathErrorf(ctx, "Cannot find relative path for %s(%s)", reflect.TypeOf(path).Name(), path)
866: 	dir := filepath.Join(p.config.srcDir, p.path, relDir)
869: 		reportPathErrorf(ctx, "Path may not contain a glob: %s", dir)
883: // OutputPath is a Path representing an intermediates file path rooted from the build directory
896: 	p.basePath.rel = filepath.Base(p.basePath.path)
904: var _ Path = OutputPath{}
911: 	path, err := validatePath(pathComponents...)
915: 	fullPath := filepath.Join(ctx.Config().buildDir, path)
916: 	path = fullPath[len(fullPath)-len(path):]
917: 	return OutputPath{basePath{path, ctx.Config(), ""}, fullPath}
923: 	for i, path := range paths {
924: 		ret[i] = PathForOutput(ctx, path)
935: // Join creates a new OutputPath with paths... joined with the current path. The
936: // provided paths... may not use '..' to escape from the current path.
938: 	path, err := validatePath(paths...)
942: 	return p.withRel(path)
950: 	ret := PathForOutput(ctx, pathtools.ReplaceExtension(p.path, ext))
957: 	path, err := validatePath(paths...)
962: 	ret := PathForOutput(ctx, filepath.Dir(p.path), path)
963: 	ret.rel = filepath.Join(filepath.Dir(p.rel), path)
970: 	path, err := validatePath(paths...)
974: 	return PathForOutput(ctx, ".intermediates", path)
981: // PathForModuleSrc returns a Path representing the paths... under the
994: 				ctx.ModuleErrorf(`%s, is the property annotated with android:"path"?`, depErr.Error())
1015: 	path, err := pathForSource(ctx, ctx.ModuleDir(), p)
1020: 	path.basePath.rel = p
1022: 	return path
1025: // PathsWithModuleSrcSubDir takes a list of Paths and returns a new list of Paths where Rel() on each path
1026: // will return the path relative to subDir in the module's source directory.  If any input paths are not located
1027: // inside subDir then a path error will be reported.
1031: 	for i, path := range paths {
1032: 		rel := Rel(ctx, subDirFullPath.String(), path.String())
1038: // PathWithModuleSrcSubDir takes a Path and returns a Path where Rel() will return the path relative to subDir in the
1039: // module's source directory.  If the input path is not located inside subDir then a path error will be reported.
1042: 	rel := Rel(ctx, subDirFullPath.String(), path.String())
1047: // valid path if p is non-nil.
1056: 	return PathForModuleGen(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1060: 	return PathForModuleObj(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1065: 	return PathForModuleRes(ctx, p.path, name)
1068: // ModuleOutPath is a Path representing a module's output directory.
1073: var _ Path = ModuleOutPath{}
1076: 	return PathForModuleObj(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1083: // PathForVndkRefAbiDump returns an OptionalPath representing the path of the
1121: // PathForModuleOut returns a Path representing the paths... under the module's
1133: // ModuleGenPath is a Path representing the 'gen' directory in a module's output
1139: var _ Path = ModuleGenPath{}
1143: // PathForModuleGen returns a Path representing the paths... under the module's
1158: 	// TODO: make a different path for local vs remote generated files?
1159: 	return PathForModuleGen(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1163: 	return PathForModuleObj(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1166: // ModuleObjPath is a Path representing the 'obj' directory in a module's output
1172: var _ Path = ModuleObjPath{}
1174: // PathForModuleObj returns a Path representing the paths... under the module's
1184: // ModuleResPath is a a Path representing the 'res' directory in a module's
1190: var _ Path = ModuleResPath{}
1192: // PathForModuleRes returns a Path representing the paths... under the module's
1203: // InstallPath is a Path representing a installed file path rooted from the build directory
1214: var _ Path = InstallPath{}
1220: 	return filepath.Join(p.config.buildDir, p.baseDir, p.path)
1223: // Join creates a new InstallPath with paths... joined with the current path. The
1224: // provided paths... may not use '..' to escape from the current path.
1226: 	path, err := validatePath(paths...)
1230: 	return p.withRel(path)
1245: // PathForModuleInstall returns a Path representing the install path for the
1286: 	path, err := validatePath(outPaths...)
1291: 	ret := InstallPath{basePath{path, ctx.Config(), ""}, ""}
1298: 	path, err := validatePath(paths...)
1302: 	return InstallPath{basePath{path, ctx.Config(), ""}, ""}
1314: 	rel := Rel(ctx, PathForOutput(ctx, "target", "product", ctx.Config().DeviceName()).String(), path.String())
1371: 	for i, path := range p {
1372: 		ret[i] = path
1383: 	for i, path := range p {
1384: 		ret[i] = path.String()
1389: // validateSafePath validates a path that we trust (may contain ninja variables).
1390: // Ensures that each path component does not attempt to leave its component.
1392: 	for _, path := range pathComponents {
1393: 		path := filepath.Clean(path)
1394: 		if path == ".." || strings.HasPrefix(path, "../") || strings.HasPrefix(path, "/") {
1395: 			return "", fmt.Errorf("Path is outside directory: %s", path)
1404: // validatePath validates that a path does not include ninja variables, and that
1405: // each path component does not attempt to leave its component. Returns a joined
1406: // version of each path component.
1408: 	for _, path := range pathComponents {
1409: 		if strings.Contains(path, "$") {
1410: 			return "", fmt.Errorf("Path contains invalid character($): %s", path)
1433: var _ Path = PhonyPath{}
1441: 	return p.path
1444: // PathForTesting returns a Path constructed from joining the elements of paths with '/'.  It should only be used from
1451: 	return testPath{basePath{path: p, rel: p}}
1454: // PathsForTesting returns a Path constructed from each element in strs. It should only be used from within tests.
1484: 		reportPathErrorf(ctx, "path %q is not under path %q", targetPath, basePath)
1501: 	// filepath.Rel returns an error if one path is absolute and the other is not, handle that case first.
1516: func WriteFileToOutputDir(path WritablePath, data []byte, perm os.FileMode) error {
1517: 	return ioutil.WriteFile(absolutePath(path.String()), data, perm)
1521: 	if filepath.IsAbs(path) {
1522: 		return path
1524: 	return filepath.Join(absSrcDir, path)
27: 	"github.com/google/blueprint/pathtools"
32: // PathContext is the subset of a (Module|Singleton)Context required by the
43: var _ PathContext = SingletonContext(nil)
44: var _ PathContext = ModuleContext(nil)
126: 	// directory, and OutputPath.Join("foo").Rel() would return "foo".
137: 	// the writablePath method doesn't directly do anything,
138: 	// but it allows a struct to distinguish between whether or not it implements the WritablePath interface
159: 	return PathForModuleGen(ctx)
169: 	return PathForModuleObj(ctx)
180: 	return PathForModuleRes(ctx)
192: 		return OptionalPath{}
198: func (p OptionalPath) Valid() bool {
212: func (p OptionalPath) String() string {
223: // PathsForSource returns Paths rooted from SrcDir
225: 	ret := make(Paths, len(paths))
232: // ExistentPathsForSources returns a list of Paths rooted from SrcDir that are
236: 	ret := make(Paths, 0, len(paths))
246: // PathsForModuleSrc returns Paths rooted from the module's local source directory.  It expands globs, references to
248: // ":name{.tag}" syntax.  Properties passed as the paths argument must have been annotated with struct tag
253: 	return PathsForModuleSrcExcludes(ctx, paths, nil)
256: // PathsForModuleSrcExcludes returns Paths rooted from the module's local source directory, excluding paths listed in
258: ...(2 bytes skipped)... references to OutputFileProducer modules using the ":name{.tag}" syntax.  Properties passed as the paths or excludes
264: 	ret, missingDeps := PathsAndMissingDepsForModuleSrcExcludes(ctx, paths, excludes)
275: // OutputPaths is a slice of OutputPath objects, with helpers to operate on the collection.
278: // Paths returns the OutputPaths as a Paths
283: 	ret := make(Paths, len(p))
290: // Strings returns the string forms of the writable paths.
302: // PathsAndMissingDepsForModuleSrcExcludes returns Paths rooted from the module's local source directory, excluding
303: // paths listed in the excludes arguments, and a list of missing dependencies.  It expands globs, reference...(4 bytes skipped)...
305: // ":name{.tag}" syntax.  Properties passed as the paths or excludes argument must have been annotated with struct tag
311: 	prefix := pathForModuleSrc(ctx).String()
341: 			expandedExcludes = append(expandedExcludes, filepath.Join(prefix, e))
345: 	if paths == nil {
351: 	expandedSrcFiles := make(Paths, 0, len(paths))
352: 	for _, s := range paths {
353: 		srcFiles, err := expandOneSrcPath(ctx, s, expandedExcludes)
401: 	} else if pathtools.IsGlob(s) {
402: 		paths := ctx.GlobFiles(pathForModuleSrc(ctx, s).String(), expandedExcludes)
403: 		return PathsWithModuleSrcSubDir(ctx, paths, ""), nil
405: 		p := pathForModuleSrc(ctx, s)
416: 		return Paths{p}, nil
420: // pathsForModuleSrcFromFullPath returns Paths rooted from the module's local
422: // each string. If incDirs is false, strip paths with a trailing '/' from the list.
426: 	prefix := filepath.Join(ctx.Config().srcDir, ctx.ModuleDir()) + "/"
430: 	ret := make(Paths, 0, len(paths))
431: 	for _, p := range paths {
449: 		ret = append(ret, srcPath)
454: // PathsWithOptionalDefaultForModuleSrc returns Paths rooted from the module's
458: 		return PathsForModuleSrc(ctx, input)
466: // Strings returns the Paths in string form
467: func (p Paths) Strings() []string {
478: // FirstUniquePaths returns all unique elements of a Paths, keeping the first copy of each.  It
479: // modifies the Paths slice contents in place, and returns a subslice of the original slice.
526: // LastUniquePaths returns all unique elements of a Paths, keeping the last copy of each.  It
527: // modifies the Paths slice contents in place, and returns a subslice of the original slice.
544: // ReversePaths returns a copy of a Paths in reverse order.
549: 	ret := make(Paths, len(list))
586: // HasExt returns true of any of the paths have extension ext, otherwise false
587: func (p Paths) HasExt(ext string) bool {
597: // FilterByExt returns the subset of the paths that have extension ext
598: func (p Paths) FilterByExt(ext string) Paths {
599: 	ret := make(Paths, 0, len(p))
608: // FilterOutByExt returns the subset of the paths that do not have extension ext
609: func (p Paths) FilterOutByExt(ext string) Paths {
610: 	ret := make(Paths, 0, len(p))
619: // DirectorySortedPaths is a slice of paths that are sorted such that all files in a directory
625: 	ret := append(DirectorySortedPaths(nil), paths...)
632: // PathsInDirectory returns a subslice of the DirectorySortedPaths as a Paths that contains all entries
635: 	prefix := filepath.Clean(dir) + "/"
648: 	return Paths(ret)
654: // Strings returns the string forms of the writable paths.
666: // Paths returns the WritablePaths as a Paths
671: 	ret := make(Paths, len(p))
684: func (p basePath) Ext() string {
688: func (p basePath) Base() string {
692: func (p basePath) Rel() string {
699: func (p basePath) String() string {
703: func (p basePath) withRel(rel string) basePath {
716: func (p SourcePath) withRel(rel string) SourcePath {
717: 	p.basePath = p.basePath.withRel(rel)
721: // safePathForSource is for paths that we expect are safe -- only for use by go
722: // code that is embedding ninja variables in paths
724: 	p, err := validateSafePath(pathComponents...)
725: 	ret := SourcePath{basePath{p, ctx.Config(), ""}}
738: // pathForSource creates a SourcePath from pathComponents, but does not check that it exists.
740: 	p, err := validatePath(pathComponents...)
741: 	ret := SourcePath{basePath{p, ctx.Config(), ""}}
759: 	if gctx, ok := ctx.(PathGlobContext); ok {
780: // On error, it will return a usable, but invalid SourcePath, and report a ModuleError.
807: // ExistentPathForSource returns an OptionalPath with the SourcePath if the
814: 		return OptionalPath{}
819: 		return OptionalPath{}
825: 		return OptionalPath{}
828: 		return OptionalPath{}
833: func (p SourcePath) String() string {
839: func (p SourcePath) Join(ctx PathContext, paths ...string) SourcePath {
848: func (p SourcePath) join(ctx PathContext, paths ...string) SourcePath {
864: 		return OptionalPath{}
868: 	if pathtools.IsGlob(dir) {
871: 	paths, err := ctx.GlobWithDeps(dir, nil)
874: 		return OptionalPath{}
876: 	if len(paths) == 0 {
877: 		return OptionalPath{}
879: 	relPath := Rel(ctx, p.config.srcDir, paths[0])
880: 	return OptionalPathForPath(PathForSource(ctx, relPath))
889: func (p OutputPath) withRel(rel string) OutputPath {
890: 	p.basePath = p.basePath.withRel(rel)
891: 	p.fullPath = filepath.Join(p.fullPath, rel)
895: func (p OutputPath) WithoutRel() OutputPath {
900: func (p OutputPath) buildDir() string {
905: var _ WritablePath = OutputPath{}
907: // PathForOutput joins the provided paths and returns an OutputPath that is
909: // On error, it will return a usable, but invalid OutputPath, and report a ModuleError.
920: // PathsForOutput returns Paths rooted from buildDir
922: 	ret := make(WritablePaths, len(paths))
931: func (p OutputPath) String() string {
932: 	return p.fullPath
937: func (p OutputPath) Join(ctx PathContext, paths ...string) OutputPath {
945: // ReplaceExtension creates a new OutputPath with the extension replaced with ext.
946: func (p OutputPath) ReplaceExtension(ctx PathContext, ext string) OutputPath {
951: 	ret.rel = pathtools.ReplaceExtension(p.rel, ext)
955: // InSameDir creates a new OutputPath from the directory of the current OutputPath joined with the elements in paths.
956: func (p OutputPath) InSameDir(ctx PathContext, paths ...string) OutputPath {
967: // PathForIntermediates returns an OutputPath representing the top-level
977: var _ genPathProvider = SourcePath{}
978: var _ objPathProvider = SourcePath{}
979: var _ resPathProvider = SourcePath{}
984: 	p, err := validatePath(pathComponents...)
988: 	paths, err := expandOneSrcPath(ctx, p, nil)
1000: 	} else if len(paths) == 0 {
1003: 	} else if len(paths) > 1 {
1004: 		reportPathErrorf(ctx, "%q produced %d files, expected exactly one", p, len(paths))
1006: 	return paths[0]
1010: 	p, err := validatePath(paths...)
1029: 	paths = append(Paths(nil), paths...)
1030: 	subDirFullPath := pathForModuleSrc(ctx, subDir)
1033: 		paths[i] = subDirFullPath.join(ctx, rel)
1035: 	return paths
1041: 	subDirFullPath := pathForModuleSrc(ctx, subDir)
1043: 	return subDirFullPath.Join(ctx, rel)
1046: // OptionalPathForModuleSrc returns an OptionalPath. The OptionalPath contains a
1050: 		return OptionalPath{}
1052: 	return OptionalPathForPath(PathForModuleSrc(ctx, *p))
1080: 	return PathForOutput(ctx, ".intermediates", ctx.ModuleDir(), ctx.ModuleName(), ctx.ModuleSubDir())
1086: 	isNdk, isLlndkOrVndk, isGzip bool) OptionalPath {
1124: 	p, err := validatePath(paths...)
1128: 	return ModuleOutPath{
1129: 		OutputPath: pathForModule(ctx).withRel(p),
1140: var _ genPathProvider = ModuleGenPath{}
1141: var _ objPathProvider = ModuleGenPath{}
1146: 	p, err := validatePath(paths...)
1150: 	return ModuleGenPath{
1151: 		ModuleOutPath: ModuleOutPath{
1152: 			OutputPath: pathForModule(ctx).withRel("gen").withRel(p),
1177: 	p, err := validatePath(pathComponents...)
1181: 	return ModuleObjPath{PathForModuleOut(ctx, "obj", p)}
1195: 	p, err := validatePath(pathComponents...)
1200: 	return ModuleResPath{PathForModuleOut(ctx, "res", p)}
1207: 	baseDir string // "../" for Make paths to convert "out/soong" to "out", "" for Soong paths
1210: func (p InstallPath) buildDir() string {
1215: var _ WritablePath = InstallPath{}
1219: func (p InstallPath) String() string {
1225: func (p InstallPath) Join(ctx PathContext, paths ...string) InstallPath {
1233: func (p InstallPath) withRel(rel string) InstallPath {
1234: 	p.basePath = p.basePath.withRel(rel)
1238: // ToMakePath returns a new InstallPath that points to Make's install directory instead of Soong's,
1246: // module appended with paths...
1254: 	ret := pathForInstall(ctx, os, partition, ctx.Debug(), pathComponents...)
1257: 		ret = ret.ToMakePath()
1264: 	pathComponents ...string) InstallPath {
1284: 	outPaths = append(outPaths, pathComponents...)
1297: 	paths = append([]string{prefix}, paths...)
1306: 	return pathForNdkOrSdkInstall(ctx, "ndk", paths)
1310: 	return pathForNdkOrSdkInstall(ctx, "mainline-sdks", paths)
1344: 			partition = ctx.DeviceConfig().VendorPath()
1346: 			partition = ctx.DeviceConfig().OdmPath()
1348: 			partition = ctx.DeviceConfig().ProductPath()
1350: 			partition = ctx.DeviceConfig().SystemExtPath()
1365: // Paths returns the InstallPaths as a Paths
1370: 	ret := make(Paths, len(p))
1377: // Strings returns the string forms of the install paths.
1398: 	// TODO: filepath.Join isn't necessarily correct with embedded ninja
1401: 	return filepath.Join(pathComponents...), nil
1413: 	return validateSafePath(pathComponents...)
1420: 	return PhonyPath{basePath{phony, ctx.Config(), ""}}
1429: func (p PhonyPath) buildDir() string {
1434: var _ WritablePath = PhonyPath{}
1440: func (p testPath) String() string {
1447: 	p, err := validateSafePath(paths...)
1456: 	p := make(Paths, len(strs))
1458: 		p[i] = PathForTesting(s)
1471: // PathContextForTesting returns a PathContext that can be used in tests, for example to create an OutputPath with
1472: // PathForOutput.
1479: // Rel performs the same function as filepath.Rel, but reports errors to a PathContext, and reports an error if
1480: // targetPath is not inside basePath.
1481: func Rel(ctx PathContext, basePath string, targetPath string) string {
1482: 	rel, isRel := MaybeRel(ctx, basePath, targetPath)
1490: // MaybeRel performs the same function as filepath.Rel, but reports errors to a PathContext, and returns false if
1491: // targetPath is not inside basePath.
1492: func MaybeRel(ctx PathContext, basePath string, targetPath string) (string, bool) {
1493: 	rel, isRel, err := maybeRelErr(basePath, targetPath)
1500: func maybeRelErr(basePath string, targetPath string) (string, bool, error) {
1502: 	if filepath.IsAbs(basePath) != filepath.IsAbs(targetPath) {
1505: 	rel, err := filepath.Rel(basePath, targetPath)
51: func (NullPathContext) AddNinjaFileDeps(...string) {}
52: func (ctx NullPathContext) Config() Config         { return ctx.config }
67: var _ ModuleInstallPathContext = ModuleContext(nil)
85: // reportPathError will register an error with the attached context. It
89: 	reportPathErrorf(ctx, "%s", err.Error())
92: // reportPathErrorf will register an error with the attached context. It
291: func (p OutputPaths) Strings() []string {
357: 			reportPathError(ctx, err)
407: 			reportPathErrorf(ctx, "%s: %s", p, err.Error())
408: 		} else if !exists && !ctx.Config().testAllowNonExistentPaths {
443: 			reportPathError(ctx, err)
481: 	// 128 was chosen based on BenchmarkFirstUniquePaths results.
483: 		return firstUniquePathsMap(list)
485: 	return firstUniquePathsList(list)
488: // SortedUniquePaths returns what its name says
490: 	unique := FirstUniquePaths(list)
567: 	return indexPathList(p, list) != -1
651: // WritablePaths is a slice of WritablePaths, used for multiple outputs.
655: func (p WritablePaths) Strings() []string {
784: 		reportPathError(ctx, err)
794: 			reportPathError(ctx, err)
801: 	} else if !exists && !ctx.Config().testAllowNonExistentPaths {
813: 		reportPathError(ctx, err)
824: 		reportPathError(ctx, err)
842: 		reportPathError(ctx, err)
851: 		reportPathError(ctx, err)
873: 		reportPathErrorf(ctx, "glob: %s", err.Error())
913: 		reportPathError(ctx, err)
940: 		reportPathError(ctx, err)
948: 		reportPathErrorf(ctx, "extension %q cannot contain /", ext)
959: 		reportPathError(ctx, err)
972: 		reportPathError(ctx, err)
986: 		reportPathError(ctx, err)
997: 			reportPathError(ctx, err)
1001: 		reportPathErrorf(ctx, "%q produced no files, expected exactly one", p)
1012: 		reportPathError(ctx, err)
1017: 		reportPathError(ctx, err)
1116: 	return ExistentPathForSource(ctx, "prebuilts", "abi-dumps", dirName,
1126: 		reportPathError(ctx, err)
1148: 		reportPathError(ctx, err)
1179: 		reportPathError(ctx, err)
1197: 		reportPathError(ctx, err)
1228: 		reportPathError(ctx, err)
1266: 	var outPaths []string
1269: 		outPaths = []string{"target", "product", ctx.Config().DeviceName(), partition}
1273: 			outPaths = []string{"host", "linux-x86", partition}
1276: 			outPaths = []string{"host", "linux_bionic-x86", partition}
1278: 			outPaths = []string{"host", os.String() + "-x86", partition}
1282: 		outPaths = append([]string{"debug"}, outPaths...)
1288: 		reportPathError(ctx, err)
1300: 		reportPathError(ctx, err)
1319: func modulePartition(ctx ModuleInstallPathContext, os OsType) string {
1378: func (p InstallPaths) Strings() []string {
1418: 		reportPathErrorf(ctx, "Phony target contains invalid character ($ or /): %s", phony)
1468: func (x *testPathContext) Config() Config             { return x.config }
1469: func (x *testPathContext) AddNinjaFileDeps(...string) {}
1474: 	return &testPathContext{
1495: 		reportPathError(ctx, err)
chromium.googlesource.com/arc/arc:third_party/android/frameworks/base/libs/hwui/PathCache.h: [ master, ]
120:         struct Path {
122:         } path;
284:         const SkPath path;
49:     #define PATH_LOGD(...) ALOGD(__VA_ARGS__)
51:     #define PATH_LOGD(...)
230:     typedef Pair<SkPath*, SkPath*> path_pair_t;
61: struct PathTexture: public Texture {
62:     PathTexture(Caches& caches): Texture(caches) {
107:     kShapePath
110: struct PathDescription {
118:     SkPathEffect* pathEffect;
121:             const SkPath* mPath;
160: class PathCache: public OnEntryRemoved<PathDescription, PathTexture*> {
272:     class PathTask: public Task<SkBitmap*> {
274:         PathTask(const SkPath* path, const SkPaint* paint, PathTexture* texture):
291:     class PathProcessor: public TaskProcessor<SkBitmap*> {
18: #define ANDROID_HWUI_PATH_CACHE_H
65:     ~PathTexture() {
278:         ~PathTask() {
294:         ~PathProcessor() { }
17: #ifndef ANDROID_HWUI_PATH_CACHE_H
59:  * Alpha texture used to represent a path.
70:      * Left coordinate of the path bounds.
74:      * Top coordinate of the path bounds.
78:      * Offset to draw the path at the correct origin.
169:     void operator()(PathDescription& path, PathTexture*& texture);
195:     PathTexture* get(const SkPath* path, const SkPaint* paint);
198:      * Removes the specified path. This is meant to be called from threads
201:     void removeDeferred(SkPath* path);
219:      * Precaches the specified path using background threads.
221:     void precache(const SkPath* path, const SkPaint* paint);
223:     static bool canDrawAsConvexPath(SkPath* path, const SkPaint* paint);
224:     static void computePathBounds(const SkPath* path, const SkPaint* paint,
233:             const SkPath *path, const SkPaint* paint);
249:      * The pair must define first=path, second=sourcePath
251:     void remove(Vector<PathDescription>& pathsToRemove, const path_pair_t& pair);
275:             path(*path), paint(*paint), texture(texture) {
282:         // copied, since input path not refcounted / guaranteed to survive for duration of task
311:     Vector<path_pair_t> mGarbage;
318: #endif // ANDROID_HWUI_PATH_CACHE_H
35: class SkPath;
48: #if DEBUG_PATHS
98: }; // struct PathTexture
111:     DESCRIPTION_TYPE(PathDescription);
149:     PathDescription();
150:     PathDescription(ShapeType shapeType, const SkPaint* paint);
162:     PathCache();
163:     ~PathCache();
189:     PathTexture* getRoundRect(float width, float height, float rx, float ry, const SkPaint* paint);
190:     PathTexture* getCircle(float radius, const SkPaint* paint);
191:     PathTexture* getOval(float width, float height, const SkPaint* paint);
192:     PathTexture* getRect(float width, float height, const SkPaint* paint);
193:     PathTexture* getArc(float width, float height, float startAngle, float sweepAngle,
232:     PathTexture* addTexture(const PathDescription& entry,
234:     PathTexture* addTexture(const PathDescription& entry, SkBitmap* bitmap);
240:     void generateTexture(const PathDescription& entry, SkBitmap* bitmap, PathTexture* texture,
243:     PathTexture* get(const PathDescription& entry) {
259:     void removeTexture(PathTexture* texture);
288:         PathTexture* texture;
293:         PathProcessor(Caches& caches);
302:     LruCache<PathDescription, PathTexture*> mCache;
309:     sp<PathProcessor> mProcessor;
313: }; // class PathCache
android.googlesource.com/platform/tools/gpu:service/path/path_binary.go: [ master, ]
6: package path
76: 		o.Array = obj.(Path)
113: 	Package: "path",
116: 		{Declared: "Array", Type: &schema.Interface{Name: "Path"}},
163: 	Package: "path",
218: 	Package: "path",
284: 	Package: "path",
334: 	Package: "path",
383: 	Package: "path",
412: 		o.Struct = obj.(Path)
449: 	Package: "path",
452: 		{Declared: "Struct", Type: &schema.Interface{Name: "Path"}},
505: 	Package: "path",
554: 	Package: "path",
592: 		o.Map = obj.(Path)
633: 	Package: "path",
636: 		{Declared: "Map", Type: &schema.Interface{Name: "Path"}},
722: 	Package: "path",
780: 	Package: "path",
812: 		o.Array = obj.(Path)
857: 	Package: "path",
860: 		{Declared: "Array", Type: &schema.Interface{Name: "Path"}},
914: 	Package: "path",
963: 	Package: "path",
github.com/GNOME/gegl:gegl/property-types/gegl-path.c: [ mainline, ]
42:   GeglPathList *path;
44:   GeglPathList *flat_path; /*< cache of flat path */
1005: gegl_path_get_path (GeglPath *path)
1013: gegl_path_get_flat_path (GeglPath *path)
1719: #define GEGL_PARAM_PATH(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_PARAM_PATH, GeglParamPath))
1769: gegl_param_spec_path   (const gchar *name,
1722: typedef struct _GeglParamPath GeglParamPath;
1724: struct _GeglParamPath
45:   gboolean      flat_path_clean;
65: #define GEGL_PATH_GET_PRIVATE(o) \
70:   GEGL_PATH_CHANGED,
71:   GEGL_PATH_LAST_SIGNAL
74: guint gegl_path_signals[GEGL_PATH_LAST_SIGNAL] = { 0 };
189: gegl_path_init (GeglPath *self)
201: gegl_path_class_init (GeglPathClass *klass)
262: gegl_path_new (void)
269: gegl_path_new_from_string (const gchar *path_string)
277: gegl_path_is_empty (GeglPath *path)
284: gegl_path_get_n_nodes  (GeglPath *vector)
301: gegl_path_get_length (GeglPath *self)
317: gegl_path_get_node (GeglPath     *vector,
347: gegl_path_to_string (GeglPath  *vector)
398: gegl_path_set_matrix (GeglPath    *path,
413: void gegl_path_get_matrix (GeglPath    *path,
421: gegl_path_closest_point (GeglPath *path,
513: gegl_path_calc (GeglPath   *self,
558: gegl_path_calc_values (GeglPath *self,
571: gegl_path_get_bounds (GeglPath *self,
633: gegl_path_foreach (GeglPath     *vector,
650: gegl_path_foreach_flat (GeglPath     *vector,
668: gegl_path_clear (GeglPath *vector)
678: gegl_path_insert_node (GeglPath           *vector,
724: gegl_path_replace_node (GeglPath           *vector,
759: gegl_path_remove_node (GeglPath *vector,
793: gegl_path_dirty (GeglPath *path)
802: gegl_path_parse_string (GeglPath    *vector,
866: gegl_path_append (GeglPath *self,
947: gegl_path_freeze (GeglPath *path)
954: gegl_path_thaw (GeglPath *path)
962: gegl_path_add_type (gchar        type,
982: gegl_path_add_flattener (GeglPathList *(*flattener) (GeglPathList *original))
1039: gegl_path_emit_changed (GeglPath            *self,
1316: gegl_path_item_free (GeglPathList *p)
1324: gegl_path_list_destroy (GeglPathList *path)
1337: gegl_path_list_append (GeglPathList *head,
1376: gegl_path_list_append_item  (GeglPathList  *head,
1418: gegl_path_list_flatten (GeglMatrix3  *matrix,
1443: gegl_path_list_calc (GeglPathList *path,
1526: gegl_path_list_calc_values (GeglPathList *path,
1603: gegl_path_list_get_length (GeglPathList *path)
1651: gegl_path_point_lerp (GeglPathPoint  *dest,
1661: gegl_path_point_dist (GeglPathPoint *a,
1670: gint gegl_path_calc_y_for_x (GeglPath *path,
1720: #define GEGL_IS_PARAM_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEGL_TYPE_PARAM_PATH))
1744: gegl_param_path_get_type (void)
34: struct _GeglPathClass
40: struct _GeglPathPrivate
61: typedef struct _GeglPathPrivate  GeglPathPrivate;
27: #include "gegl-path.h"
63: G_DEFINE_TYPE_WITH_PRIVATE (GeglPath, gegl_path, G_TYPE_OBJECT)
66:   ((GeglPathPrivate *) gegl_path_get_instance_private ((GeglPath *) (o)))
85:    * @head: head of the new path
86:    * @prev: current tail of the new path
91:    * This function is called for each node of the path to be flattened.
92:    * This function should build a new flattened path on the fly.
95:    * Return a pointer to the head of the flattened path.
116: static void             gegl_path_emit_changed        (GeglPath         *self,
147: static void             gegl_path_item_free           (GeglPathList     *p);
148: static GeglPathList *   gegl_path_list_append_item    (GeglPathList     *head,
152: static GeglPathList *   gegl_path_list_flatten        (GeglMatrix3      *matrix,
154: static gboolean         gegl_path_list_calc           (GeglPathList     *path,
160: static void             gegl_path_list_calc_values    (GeglPathList     *path,
164: static gdouble          gegl_path_list_get_length     (GeglPathList     *path);
170:  * "SVG path" parser/serializer.
192:   priv = GEGL_PATH_GET_PRIVATE (self);
193:   priv->flat_path_clean = FALSE;
209:   gegl_path_signals[GEGL_PATH_CHANGED] =
220:   GeglPath        *self = GEGL_PATH (gobject);
221:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (self);
224:   if (priv->path)
225:     gegl_path_list_destroy (priv->path);
226:   if (priv->flat_path)
227:     gegl_path_list_destroy (priv->flat_path);
230:   G_OBJECT_CLASS (gegl_path_parent_class)->finalize (gobject);
264:   return g_object_new (GEGL_TYPE_PATH,
271:   GeglPath *self = gegl_path_new ();
272:   gegl_path_parse_string (self, path_string);
279:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (path);
280:   return priv->path == NULL;
291:   priv = GEGL_PATH_GET_PRIVATE (vector);
293:   for (iter = priv->path; iter; iter=iter->next)
303:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (self);
310:       priv->length = gegl_path_list_get_length (priv->flat_path);
321:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
325:   for (iter = priv->path; iter; iter=iter->next)
356:   priv = GEGL_PATH_GET_PRIVATE (vector);
357:   for (iter = priv->path; iter; iter=iter->next)
402:   if (!path)
404:       g_warning ("EEek! no path\n");
407:   priv = GEGL_PATH_GET_PRIVATE (path);
409:   priv->flat_path_clean = FALSE;
416:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (path);
428:   gdouble length = gegl_path_get_length (path);
448:   gegl_path_calc_values (path, n, samples_x, samples_y);
480:       GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (path);
484:       for (iter=priv->path,i=0; iter;i++,iter=iter->next)
489:           dist = gegl_path_closest_point (path,
518:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (self);
528:   entry = priv->flat_path;
541:   if (gegl_path_list_calc (entry,rel_pos,xd,yd,&stop,&leftover))
563:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (self);
567:   gegl_path_list_calc_values (priv->flat_path, num_samples, xs, ys);
596:   priv = GEGL_PATH_GET_PRIVATE (self);
599:   iter = priv->flat_path;
642:   priv = GEGL_PATH_GET_PRIVATE (vector);
643:   for (iter = priv->path; iter; iter=iter->next)
659:   priv = GEGL_PATH_GET_PRIVATE (vector);
661:   for (iter = priv->flat_path; iter; iter=iter->next)
670:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
671:   if (priv->path)
672:     gegl_path_list_destroy (priv->path);
673:   priv->path = NULL;
682:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
688:   for (iter = priv->path; iter; iter=iter->next)
699:           priv->flat_path_clean = FALSE;
701:           gegl_path_emit_changed (vector, NULL);
716:         priv->path = new;
718:   priv->flat_path_clean = FALSE;
720:   gegl_path_emit_changed (vector, NULL);
728:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
733:   for (iter = priv->path; iter; iter=iter->next)
739:           priv->flat_path_clean = FALSE;
742:           gegl_path_emit_changed (vector, NULL);
753:   priv->flat_path_clean = FALSE;
755:   gegl_path_emit_changed (vector, NULL);
762:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
769:     pos = gegl_path_get_n_nodes (vector)-1;
771:   for (iter = priv->path; iter; iter=iter->next)
778:             priv->path = iter->next;
779:           gegl_path_item_free (iter);
786:   priv->flat_path_clean = FALSE;
789:   gegl_path_emit_changed (vector, NULL);
795:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (path);
796:   priv->flat_path_clean = FALSE;
798:   gegl_path_emit_changed (path, NULL);
803:                         const gchar *path)
805:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
806:   const gchar *p = path;
834:                 priv->path = gegl_path_list_append (priv->path, type, 0., 0.);
839:                 priv->path = gegl_path_list_append (priv->path, type, x0, y0);
844:                 priv->path = gegl_path_list_append (priv->path, type, x0, y0, x1, y1);
850:                 priv->path = gegl_path_list_append (priv->path, type, x0, y0, x1, y1, x2, y2);
862:   gegl_path_dirty (vector);
876:   priv = GEGL_PATH_GET_PRIVATE (self);
884:   priv->path = gegl_path_list_append_item (priv->path, type, &iter, ensure_tail(priv));
894:   priv->flat_path_clean = FALSE;
898:       /* special case lineto so that the full path doesn't need
908:       for (iter2=priv->path;iter2 && iter2->next != iter && iter2->next;iter2=iter2->next);
937:       gegl_path_emit_changed (self, &rect);
941:       gegl_path_emit_changed (self, NULL);
949:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (path);
956:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (path);
958:   gegl_path_emit_changed (path, NULL); /* expose a full changed */
984:   GeglPath *vector = g_object_new (GEGL_TYPE_PATH, NULL);
985:   GeglPathClass *klass= GEGL_PATH_GET_CLASS (vector);
1007:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (path);
1009:   return priv->path;
1015:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (path);
1017:   ensure_flattened (path);
1018:   return priv->flat_path;
1042:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (self);
1053:   if (! gegl_path_is_empty (self))
1055:       gegl_path_get_bounds (self, &min_x, &max_x, &min_y, &max_y);
1095:   priv->cached_extent_empty = gegl_path_is_empty (self);
1099:       g_signal_emit (self, gegl_path_signals[GEGL_PATH_CHANGED], 0,
1115:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
1117:   GeglPathList *path = priv->path;
1118:   GeglPathList *new_path;
1119:   GeglPathList *old_path = NULL;
1120:   GeglPathClass *klass= GEGL_PATH_GET_CLASS (vector);
1122:   if (priv->flat_path_clean)
1124:   if (priv->flat_path)
1125:     old_path = priv->flat_path;
1129:       new_path = klass->flattener[i] (path);
1130:       if (new_path != path)
1132:           if (path != priv->path)
1133:             gegl_path_list_destroy (path);
1134:           path = new_path;
1138:   priv->flat_path = gegl_path_list_flatten (&priv->matrix, path);
1139:   if (old_path)
1140:     gegl_path_list_destroy (old_path);
1141:   if (path != priv->path)
1142:     gegl_path_list_destroy (path);
1143:   priv->flat_path_clean = TRUE;
1152:  * Ensure that priv->tail point to the last element of the path list
1159:   tail = priv->tail ? priv->tail : priv->path;
1185:   head = gegl_path_list_append_item (head, self->d.type, &newp, NULL);
1201:   head = gegl_path_list_append_item (head, self->d.type, &newp, NULL);
1237:       head = gegl_path_list_append (head, 'L', res.x, res.y);
1241:   head = gegl_path_list_append (head, 'L', res.x, res.y);
1305:     gegl_path_point_lerp (&ab, &prev->point[2], &curve->point[0], t);
1307:     gegl_path_point_lerp (&ab, &prev->point[0], &curve->point[0], t);
1308:   gegl_path_point_lerp (&bc, &curve->point[0], &curve->point[1], t);
1309:   gegl_path_point_lerp (&cd, &curve->point[1], &curve->point[2], t);
1310:   gegl_path_point_lerp (&abbc, &ab, &bc,t);
1311:   gegl_path_point_lerp (&bccd, &bc, &cd,t);
1312:   gegl_path_point_lerp (dest, &abbc, &bccd, t);
1326:   GeglPathList *iter = path;
1330:       gegl_path_item_free (iter);
1353:   head = gegl_path_list_append_item (head, type, &iter, NULL);
1366:  * gegl_path_list_append_item:
1396:   else /* creating new path */
1411:  * gegl_path_list_flatten:
1450:   GeglPathList *iter = path, *prev = NULL;
1454:   /* fetch the start point of the path */
1470:   /* travel along the path */
1490:               distance = gegl_path_point_dist (&a, &b);
1498:                   gegl_path_point_lerp (&spot, &a, &b, ratio);
1531:   GeglPathList *iter = path;
1532:   gdouble length = gegl_path_list_get_length (path);
1560:               distance = gegl_path_point_dist (&a, &b);
1568:                   gegl_path_point_lerp (&spot, &a, &b, ratio);
1590:             g_error ("stroking uninitialized path\n");
1605:   GeglPathList *iter = path;
1628:               distance = gegl_path_point_dist (&a, &b);
1685:   gegl_path_calc_values (path, Y_FOR_X_RES, xs, ys);
1738:                                                        GEGL_TYPE_PARAM_PATH));
1759:       param_vector_type_info.value_type = GEGL_TYPE_PATH;
1777:   param_vector = g_param_spec_internal (GEGL_TYPE_PARAM_PATH,
118: static void             ensure_flattened              (GeglPath         *vector);
260: /***** GeglPath *****/
261: GeglPath *
268: GeglPath *
1107:  * @vector: a #GeglPath
1113: ensure_flattened (GeglPath *vector)
1150:  * @priv: the private struct of a GeglPath
1714:  * A GParamSpec class to describe behavior of GeglPath as an object property
1751:         sizeof (GeglParamPath),
1761:       param_vector_type = g_param_type_register_static ("GeglParamPath",
1772:                         GeglPath  *default_vector,
1775:   GeglParamPath *param_vector;
37:   GeglPathList *(*flattener[8]) (GeglPathList *original);
43:   GeglPathList *tail; /*< for fast appending */
50:   GeglPathList *calc_stop;
97:   GeglPathList *(*flatten) (GeglMatrix3   *matrix,
98:                             GeglPathList *head,
99:                             GeglPathList *prev,
100:                             GeglPathList *self);
119: static GeglPathList *   ensure_tail                   (GeglPathPrivate  *priv);
121: static GeglPathList *   flatten_copy                  (GeglMatrix3      *matrix,
122:                                                        GeglPathList     *head,
123:                                                        GeglPathList     *prev,
124:                                                        GeglPathList     *self);
125: static GeglPathList *   flatten_rel_copy              (GeglMatrix3      *matrix,
126:                                                        GeglPathList     *head,
127:                                                        GeglPathList     *prev,
128:                                                        GeglPathList     *self);
129: static GeglPathList *   flatten_nop                   (GeglMatrix3      *matrix,
130:                                                        GeglPathList     *head,
131:                                                        GeglPathList     *prev,
132:                                                        GeglPathList     *self);
133: static GeglPathList *   flatten_curve                 (GeglMatrix3      *matrix,
134:                                                        GeglPathList     *head,
135:                                                        GeglPathList     *prev,
136:                                                        GeglPathList     *self);
140:                                                        GeglPathItem     *dst);
141: static void             copy_data                     (const GeglPathItem *src,
142:                                                        GeglPathItem     *dst);
143: static void             bezier2                       (GeglPathItem     *prev,
144:                                                        GeglPathItem     *curve,
145:                                                        GeglPathPoint    *dest,
150:                                                        GeglPathList    **res,
151:                                                        GeglPathList     *tail);
153:                                                        GeglPathList     *original);
158:                                                        GeglPathList    **stop,
191:   GeglPathPrivate *priv;
286:   GeglPathPrivate *priv;
287:   GeglPathList *iter;
319:                     GeglPathItem *node)
322:   GeglPathList *iter;
323:   GeglPathItem *last = NULL;
349:   GeglPathPrivate *priv;
352:   GeglPathList *iter;
401:   GeglPathPrivate *priv;
481:       GeglPathList *iter;
519:   GeglPathList *entry;
520:   GeglPathList *stop  = NULL;
578:   GeglPathPrivate *priv;
579:   GeglPathList    *iter;
634:                    void (*func) (const GeglPathItem *knot,
638:   GeglPathPrivate *priv;
639:   GeglPathList *iter;
651:                         void (*func) (const GeglPathItem *knot,
655:   GeglPathPrivate *priv;
656:   GeglPathList *iter;
680:                        const GeglPathItem *knot)
683:   GeglPathList *iter;
684:   GeglPathList *prev = NULL;
692:           GeglPathList *new = g_slice_alloc0 (sizeof (gpointer) + sizeof (gchar) + sizeof (gfloat)*2 *(info->n_items+3...(5 bytes skipped)...
709:       GeglPathList *new = g_slice_alloc0 (sizeof (gpointer) + sizeof (gchar) + sizeof (gfloat)*2 *(info->n_items+3...(5 bytes skipped)...
726:                         const GeglPathItem *knot)
729:   GeglPathList *iter;
730:   GeglPathList *prev = NULL;
763:   GeglPathList *iter;
764:   GeglPathList *prev = NULL;
869:   GeglPathPrivate *priv;
871:   GeglPathList *iter;
901:       GeglPathList *iter2;
1004: GeglPathList *
1012: GeglPathList *
1154: static GeglPathList *
1155: ensure_tail (GeglPathPrivate *priv)
1157:   GeglPathList *tail;
1169: static GeglPathList *
1171:              GeglPathList *head,
1172:              GeglPathList *prev,
1173:              GeglPathList *self)
1178: static GeglPathList *
1180:               GeglPathList *head,
1181:               GeglPathList *prev,
1182:               GeglPathList *self)
1184:   GeglPathList *newp;
1191: static GeglPathList *
1193:                   GeglPathList *head,
1194:                   GeglPathList *prev,
1195:                   GeglPathList *self)
1197:   GeglPathList *newp;
1220: static GeglPathList *
1222:                GeglPathList *head,
1223:                GeglPathList *prev,
1224:                GeglPathList *self)
1227:   GeglPathPoint res;
1229:   GeglPathItem *item=(void*)buf;
1257: /***** GeglPathItem *****/
1260:                 GeglPathItem *dst)
1277: copy_data (const GeglPathItem *src,
1278:            GeglPathItem       *dst)
1297: bezier2 (GeglPathItem  *prev,
1298:          GeglPathItem  *curve,
1299:          GeglPathPoint *dest,
1302:   GeglPathPoint ab,bc,cd,abbc,bccd;
1322: /***** GeglPathList *****/
1323: GeglPathList *
1329:       GeglPathList *next = iter->next;
1336: GeglPathList *
1341:   GeglPathList *iter;
1375: static GeglPathList *
1378:                              GeglPathList **res,
1379:                              GeglPathList  *tail)
1381:   GeglPathList *iter = tail?tail:head;
1413:  * @original: the #GeglPathList to flatten
1415:  * Flatten the provided GeglPathList
1417: static GeglPathList *
1419:                         GeglPathList *original)
1421:   GeglPathList *iter;
1422:   GeglPathList *self = NULL;
1424:   GeglPathList *endp = NULL;
1447:                      GeglPathList **stop,
1481:               GeglPathPoint a,b;
1495:                   GeglPathPoint spot;
1551:               GeglPathPoint a,b;
1565:                   GeglPathPoint spot;
1619:               GeglPathPoint a,b;
1649: /***** GeglPathPoint *****/
1652:                       GeglPathPoint  *a,
1653:                       GeglPathPoint  *b,
1662:                       GeglPathPoint *b)
android.googlesource.com/platform/external/boost:boost/filesystem/path.hpp: [ master, ]
49:     typedef basic_path< std::string, path_traits > path;
51:     struct path_traits
91:     template<class Path> struct is_basic_path
93:     template<> struct is_basic_path<path>
96:     template<> struct is_basic_path<wpath>
122:     template<class Path> struct path_alt_separator
125:     template<> struct path_alt_separator<wpath>
146:     class basic_path
158:       typedef basic_path<String, Traits> path_type;
165:       basic_path() {}
166:       basic_path( const string_type & s ) { operator/=( s ); }
167:       basic_path( const value_type * s )  { operator/=( s ); }
170:           basic_path( InputIterator first, InputIterator last )
173:      ~basic_path() {}
254:       basic_path   branch_path() const     { return parent_path(); }
256:       bool         has_branch_path() const { return !parent_path().empty(); }
264:       bool has_relative_path() const   { return !relative_path().empty(); }
266:       bool has_parent_path() const     { return !parent_path().empty(); }
319:       string_type  m_path; // invariant: portable path grammar
340:       basic_path( const string_type & str, name_check ) { operator/=( str ); }
341:       basic_path( const typename string_type::value_type * s, name_check )
672:       typedef Path path_type;
685:       const path_type & path1() const
690:       const path_type & path2() const
757:           boost::BOOST_FILESYSTEM_NAMESPACE::basic_path<String, Traits> path_type;
805:         typedef typename boost::BOOST_FILESYSTEM_NAMESPACE::basic_path<String, Traits> path_type;
865:         typedef typename boost::BOOST_FILESYSTEM_NAMESPACE::basic_path<String, Traits> path_type;
904:             path_type;
958:     basic_path<String, Traits> basic_path<String, Traits>::parent_path() const
982:     basic_path<String, Traits> basic_path<String, Traits>::relative_path() const
1028:     basic_path<String, Traits> basic_path<String, Traits>::root_path() const
1047:     inline bool basic_path<String, Traits>::has_root_path() const
65:     typedef basic_path< std::wstring, wpath_traits > wpath;
18: #define BOOST_FILESYSTEM_PATH_HPP
297:         const basic_path *      m_path_ptr; // path being iterated over
707:         path_type                 m_path1; // may be empty()
708:         path_type                 m_path2; // may be empty()
63:     struct BOOST_FILESYSTEM_DECL wpath_traits;
67:     struct BOOST_FILESYSTEM_DECL wpath_traits
1: //  boost/filesystem/path.hpp  -----------------------------------------------//
11: //  basic_path's stem(), extension(), and replace_extension() are based on
17: #ifndef BOOST_FILESYSTEM_PATH_HPP
30: #include <iosfwd>    // needed by basic_path inserter and extractor
46:     template<class String, class Traits> class basic_path;
48:     struct path_traits;
55:       static external_string_type to_external( const path &,
89:     //  path traits  ---------------------------------------------------------//
100:     // These only have to be specialized if Path::string_type::value_type
103:     template<class Path> struct slash
106:     template<class Path> struct dot
109:     template<class Path> struct colon
121: # ifdef BOOST_WINDOWS_PATH
133:       template<class Path>
137:         typedef typename Path::iterator iterator;
143:     //  basic_path  ----------------------------------------------------------//
148:     // invariant: m_path valid according to the portable generic path grammar
176:       basic_path & operator=( const string_type & s )
179:         m_path.clear();
181:         m_path.erase( m_path.begin(), m_path.end() );
186:       basic_path & operator=( const value_type * s )
189:         m_path.clear();
191:         m_path.erase( m_path.begin(), m_path.end() );
198:           basic_path & assign( InputIterator first, InputIterator last )
199:             { m_path.clear(); append( first, last ); return *this; }
203:       basic_path & operator/=( const basic_path & rhs )  { return operator /=( rhs.string().c_str() ); }
204:       basic_path & operator/=( const string_type & rhs ) { return operator /=( rhs.c_str() ); }
205:       basic_path & operator/=( const value_type * s );
208:           basic_path & append( InputIterator first, InputIterator last );
214:         m_path.clear();
216:         m_path.erase( m_path.begin(), m_path.end() );
220:       void swap( basic_path & rhs )
222:         m_path.swap( rhs.m_path );
223: #       ifdef BOOST_CYGWIN_PATH
228:       basic_path & remove_filename();
229:       basic_path & replace_extension( const string_type & new_extension = string_type() );
232:       basic_path & remove_leaf() { return remove_filename(); }
236:       const string_type & string() const         { return m_path; }
243:       basic_path   root_path() const;
246:       basic_path   relative_path() const;
247:       basic_path   parent_path() const;
255:       bool         has_leaf() const        { return !m_path.empty(); }
259:       bool empty() const               { return m_path.empty(); } // name consistent with std containers
261:       bool has_root_path() const;
265:       bool has_filename() const        { return !m_path.empty(); }
276:         friend class boost::BOOST_FILESYSTEM_NAMESPACE::basic_path<String, Traits>;
281:           { return m_path_ptr == rhs.m_path_ptr && m_pos == rhs.m_pos; }
283:         friend class boost::BOOST_FILESYSTEM_NAMESPACE::detail::iterator_helper<path_type>;
287:           boost::BOOST_FILESYSTEM_NAMESPACE::detail::iterator_helper<path_type>::do_increment(
292:           boost::BOOST_FILESYSTEM_NAMESPACE::detail::iterator_helper<path_type>::do_decrement(
299:                                             // path_ptr->string(). The
301:                                             // pos == path_ptr->m_path.size()
311:       // are only minor differences between generic and native path grammars.
314:       // native path formats, or between file_string() and
322: #   ifdef BOOST_CYGWIN_PATH
323:       bool m_cygwin_root; // if present, m_path[0] was slash. note: initialization
333:       friend class boost::BOOST_FILESYSTEM_NAMESPACE::detail::iterator_helper<path_type>;
348:       basic_path & canonize();
349:       basic_path & normalize();
353:   //  basic_path non-member functions  ---------------------------------------//
356:     inline void swap( basic_path<String, Traits> & lhs,
357:                basic_path<String, Traits> & rhs ) { lhs.swap( rhs ); }
360:     bool operator<( const basic_path<String, Traits> & lhs, const basic_path<String, Traits> & rhs )
367:     bool operator<( const typename basic_path<String, Traits>::string_type::value_type * lhs,
368:                     const basic_path<String, Traits> & rhs )
370:       basic_path<String, Traits> tmp( lhs );
376:     bool operator<( const typename basic_path<String, Traits>::string_type & lhs,
377:                     const basic_path<String, Traits> & rhs )
379:       basic_path<String, Traits> tmp( lhs );
385:     bool operator<( const basic_path<String, Traits> & lhs,
386:                     const typename basic_path<String, Traits>::string_type::value_type * rhs )
388:       basic_path<String, Traits> tmp( rhs );
394:     bool operator<( const basic_path<String, Traits> & lhs,
395:                     const typename basic_path<String, Traits>::string_type & rhs )
397:       basic_path<String, Traits> tmp( rhs );
407:     inline bool operator==( const basic_path<String, Traits> & lhs, const basic_path<String, Traits> & rhs )
413:     inline bool operator==( const typename basic_path<String, Traits>::string_type::value_type * lhs,
414:                     const basic_path<String, Traits> & rhs )
420:     inline bool operator==( const typename basic_path<String, Traits>::string_type & lhs,
421:                     const basic_path<String, Traits> & rhs )
427:     inline bool operator==( const basic_path<String, Traits> & lhs,
428:                     const typename basic_path<String, Traits>::string_type::value_type * rhs )
434:     inline bool operator==( const basic_path<String, Traits> & lhs,
435:                     const typename basic_path<String, Traits>::string_type & rhs )
441:     inline bool operator!=( const basic_path<String, Traits> & lhs,
442:       const basic_path<String, Traits> & rhs )
446:     inline bool operator!=( const typename basic_path<String,
448:         const basic_path<String, Traits> & rhs )
452:     inline bool operator!=( const typename basic_path<String, Traits>::string_type & lhs,
453:       const basic_path<String, Traits> & rhs )
457:     inline bool operator!=( const basic_path<String, Traits> & lhs,
458:       const typename basic_path<String, Traits>::string_type::value_type * rhs )
462:     inline bool operator!=( const basic_path<String, Traits> & lhs,
463:       const typename basic_path<String, Traits>::string_type & rhs )
467:     inline bool operator>( const basic_path<String, Traits> & lhs, const basic_path<String, Traits> & rhs ) { return rhs < lhs; }
470:     inline bool operator>( const typename basic_path<String, Traits>::string_type::value_type * lhs,
471:                     const basic_path<String, Traits> & rhs ) { return rhs < basic_path<String, Traits>(lhs); }
474:     inline bool operator>( const typename basic_path<String, Traits>::string_type & lhs,
475:                     const basic_path<String, Traits> & rhs ) { return rhs < basic_path<String, Traits>(lhs); }
478:     inline bool operator>( const basic_path<String, Traits> & lhs,
479:                     const typename basic_path<String, Traits>::string_type::value_type * rhs )
480:                     { return basic_path<String, Traits>(rhs) < lhs; }
483:     inline bool operator>( const basic_path<String, Traits> & lhs,
484:                     const typename basic_path<String, Traits>::string_type & rhs )
485:                     { return basic_path<String, Traits>(rhs) < lhs; }
488:     inline bool operator<=( const basic_path<String, Traits> & lhs, const basic_path<String, Traits> & rhs ) { return !(rhs < lhs); }
491:     inline bool operator<=( const typename basic_path<String, Traits>::string_type::value_type * lhs,
492:                     const basic_path<String, Traits> & rhs ) { return !(rhs < basic_path<String, Traits>(lhs)); }
495:     inline bool operator<=( const typename basic_path<String, Traits>::string_type & lhs,
496:                     const basic_path<String, Traits> & rhs ) { return !(rhs < basic_path<String, Traits>(lhs)); }
499:     inline bool operator<=( const basic_path<String, Traits> & lhs,
500:                     const typename basic_path<String, Traits>::string_type::value_type * rhs )
501:                     { return !(basic_path<String, Traits>(rhs) < lhs); }
504:     inline bool operator<=( const basic_path<String, Traits> & lhs,
505:                     const typename basic_path<String, Traits>::string_type & rhs )
506:                     { return !(basic_path<String, Traits>(rhs) < lhs); }
509:     inline bool operator>=( const basic_path<String, Traits> & lhs, const basic_path<String, Traits> & rhs ) { return !(lhs < rhs); }
512:     inline bool operator>=( const typename basic_path<String, Traits>::string_type::value_type * lhs,
513:                     const basic_path<String, Traits> & rhs ) { return !(lhs < basic_path<String, Traits>(rhs)); }
516:     inline bool operator>=( const typename basic_path<String, Traits>::string_type & lhs,
517:                     const basic_path<String, Traits> & rhs ) { return !(lhs < basic_path<String, Traits>(rhs)); }
520:     inline bool operator>=( const basic_path<String, Traits> & lhs,
521:                     const typename basic_path<String, Traits>::string_type::value_type * rhs )
522:                     { return !(basic_path<String, Traits>(lhs) < rhs); }
525:     inline bool operator>=( const basic_path<String, Traits> & lhs,
526:                     const typename basic_path<String, Traits>::string_type & rhs )
527:                     { return !(basic_path<String, Traits>(lhs) < rhs); }
532:     inline basic_path<String, Traits> operator/( 
533:       const basic_path<String, Traits> & lhs,
534:       const basic_path<String, Traits> & rhs )
535:       { return basic_path<String, Traits>( lhs ) /= rhs; }
538:     inline basic_path<String, Traits> operator/( 
539:       const basic_path<String, Traits> & lhs,
541:       { return basic_path<String, Traits>( lhs ) /=
542:           basic_path<String, Traits>( rhs ); }
545:     inline basic_path<String, Traits> operator/( 
546:       const basic_path<String, Traits> & lhs, const String & rhs )
547:       { return basic_path<String, Traits>( lhs ) /=
548:           basic_path<String, Traits>( rhs ); }
551:     inline basic_path<String, Traits> operator/( 
553:       const basic_path<String, Traits> & rhs )
554:       { return basic_path<String, Traits>( lhs ) /= rhs; }
557:     inline basic_path<String, Traits> operator/(
558:       const String & lhs, const basic_path<String, Traits> & rhs )
559:       { return basic_path<String, Traits>( lhs ) /= rhs; }
565:     template< class Path >
566:     std::basic_ostream< typename Path::string_type::value_type,
567:       typename Path::string_type::traits_type > &
569:       ( std::basic_ostream< typename Path::string_type::value_type,
570:       typename Path::string_type::traits_type >& os, const Path & ph )
576:     template< class Path >
577:     std::basic_istream< typename Path::string_type::value_type,
578:       typename Path::string_type::traits_type > &
580:       ( std::basic_istream< typename Path::string_type::value_type,
581:       typename Path::string_type::traits_type >& is, Path & ph )
583:       typename Path::string_type str;
595:         const basic_path< String, Traits > & ph )
607:         basic_path< String, Traits > & ph )
627:         const path & path1_arg, const path & path2_arg, std::string & target )
634:             if ( !path1_arg.empty() )
637:               target += path1_arg.file_string();
640:             if ( !path2_arg.empty() )
643:               target += path2_arg.file_string();
655:       template<class Path>
657:         const Path & /*path1_arg*/, const Path & /*path2_arg*/, std::string & /*target*/ )
665:     template<class Path>
678:         const path_type & path1_arg, system::error_code ec );
680:       basic_filesystem_error( const std::string & what_arg, const path_type & path1_arg,
681:         const path_type & path2_arg, system::error_code ec );
687:         static const path_type empty_path;
688:         return m_imp_ptr.get() ? m_imp_ptr->m_path1 : empty_path ;
692:         static const path_type empty_path;
693:         return m_imp_ptr.get() ? m_imp_ptr->m_path2 : empty_path ;
700:         return detail::what( system::system_error::what(), m_imp_ptr->m_path1,
701:           m_imp_ptr->m_path2, m_imp_ptr->m_what );  
714:     typedef basic_filesystem_error<path> filesystem_error;
720:   //  path::name_checks  -----------------------------------------------------//
738:       template<class Path>
739:       inline  bool is_separator( typename Path::string_type::value_type c )
741:         return c == slash<Path>::value
742: #     ifdef BOOST_WINDOWS_PATH
743:           || c == path_alt_separator<Path>::value
752:         const String & str, // precondition: portable generic path grammar
761:           && str[0] == slash<path_type>::value
762:           && str[1] == slash<path_type>::value ) return 0;
765:         if ( end_pos && str[end_pos-1] == slash<path_type>::value )
770:           str.find_last_of( slash<path_type>::value, end_pos-1 ) );
771: #       ifdef BOOST_WINDOWS_PATH
773:           pos = str.find_last_of( path_alt_separator<path_type>::value, end_pos-1 );
775:           pos = str.find_last_of( colon<path_type>::value, end_pos-2 );
778:         return ( pos == String::npos // path itself must be a filename (or empty)
779:           || (pos == 1 && str[0] == slash<path_type>::value) ) // or net
790:           const String & src, // precondition: portable generic path grammar
810:         if ( size >= 2 && src[0] == slash<path_type>::value
811:           && src[1] == slash<path_type>::value
813:             || src[2] != slash<path_type>::value) )
820:         else if ( src[0] == slash<path_type>::value )
825:             && src[cur+1] == slash<path_type>::value )
838: #         ifdef BOOST_WINDOWS_PATH
839:           && src[cur] != colon<path_type>::value
841:           && src[cur] != slash<path_type>::value )
847: #       ifdef BOOST_WINDOWS_PATH
850:         if ( src[cur] == colon<path_type>::value )
861:         const String & s, // precondition: portable generic path grammar
867: #     ifdef BOOST_WINDOWS_PATH
870:           && s[1] == colon<path_type>::value
871:           && s[2] == slash<path_type>::value ) return 2;
876:           && s[0] == slash<path_type>::value
877:           && s[1] == slash<path_type>::value ) return String::npos;