Found 1004392 results in 95393 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).
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);
android.googlesource.com/platform/superproject:build/soong/android/paths.go: [ master, ]
106: type Path interface {
178: 	path  Path
640: 	path   string
196: func (p OptionalPath) Path() Path {
34: type PathContext interface {
39: type PathGlobContext interface {
97: func pathContextName(ctx PathContext, module blueprint.Module) string {
123: type WritablePath interface {
131: 	writablePath()
176: type OptionalPath struct {
182: func OptionalPathForPath(path Path) OptionalPath {
213: type Paths []Path
216: func PathsForSource(ctx PathContext, paths []string) Paths {
244: func PathsForModuleSrc(ctx ModuleContext, paths []string) Paths {
255: func PathsForModuleSrcExcludes(ctx ModuleContext, paths, excludes []string) Paths {
302: func PathsAndMissingDepsForModuleSrcExcludes(ctx ModuleContext, paths, excludes []string) (Paths, []string) {
365: func expandOneSrcPath(ctx ModuleContext, s string, expandedExcludes []string) (Paths, error) {
417: func pathsForModuleSrcFromFullPath(ctx EarlyModuleContext, paths []string, incDirs bool) Paths {
448: func PathsWithOptionalDefaultForModuleSrc(ctx ModuleContext, input []string, def string) Paths {
585: func PathsToDirectorySortedPaths(paths Paths) DirectorySortedPaths {
595: func (p DirectorySortedPaths) PathsInDirectory(dir string) Paths {
639: type basePath struct {
671: type SourcePath struct {
672: 	basePath
700: func pathForSource(ctx PathContext, pathComponents ...string) (SourcePath, error) {
742: func PathForSource(ctx PathContext, pathComponents ...string) SourcePath {
819: func (p SourcePath) OverlayPath(ctx ModuleContext, path Path) OptionalPath {
845: type OutputPath struct {
846: 	basePath
847: 	fullPath string
871: func PathForOutput(ctx PathContext, pathComponents ...string) OutputPath {
882: func PathsForOutput(ctx PathContext, paths []string) WritablePaths {
890: func (p OutputPath) writablePath() {}
930: func PathForIntermediates(ctx PathContext, paths ...string) OutputPath {
944: func PathForModuleSrc(ctx ModuleContext, pathComponents ...string) Path {
970: func pathForModuleSrc(ctx ModuleContext, paths ...string) SourcePath {
989: func PathsWithModuleSrcSubDir(ctx ModuleContext, paths Paths, subDir string) Paths {
1001: func PathWithModuleSrcSubDir(ctx ModuleContext, path Path, subDir string) Path {
1030: type ModuleOutPath struct {
1031: 	OutputPath
1040: func pathForModule(ctx ModuleContext) OutputPath {
1046: func PathForVndkRefAbiDump(ctx ModuleContext, version, fileName string,
1084: func PathForModuleOut(ctx ModuleContext, paths ...string) ModuleOutPath {
1096: type ModuleGenPath struct {
1097: 	ModuleOutPath
1106: func PathForModuleGen(ctx ModuleContext, paths ...string) ModuleGenPath {
1129: type ModuleObjPath struct {
1130: 	ModuleOutPath
1137: func PathForModuleObj(ctx ModuleContext, pathComponents ...string) ModuleObjPath {
1147: type ModuleResPath struct {
1148: 	ModuleOutPath
1155: func PathForModuleRes(ctx ModuleContext, pathComponents ...string) ModuleResPath {
1165: type InstallPath struct {
1166: 	basePath
1178: func (p InstallPath) writablePath() {}
1201: func (p InstallPath) ToMakePath() InstallPath {
1208: func PathForModuleInstall(ctx ModuleInstallPathContext, pathComponents ...string) InstallPath {
1224: func pathForInstall(ctx PathContext, os OsType, partition string, debug bool,
1257: func PathForNdkInstall(ctx PathContext, paths ...string) InstallPath {
1266: func InstallPathToOnDevicePath(ctx PathContext, path InstallPath) string {
1344: func validateSafePath(pathComponents ...string) (string, error) {
1360: func validatePath(pathComponents ...string) (string, error) {
1369: func PathForPhony(ctx PathContext, phony string) WritablePath {
1376: type PhonyPath struct {
1377: 	basePath
1380: func (p PhonyPath) writablePath() {}
1389: type testPath struct {
1390: 	basePath
1399: func PathForTesting(paths ...string) Path {
1408: func PathsForTesting(strs ...string) Paths {
1426: func PathContextForTesting(config Config) PathContext {
1473: func absolutePath(path string) string {
271: func (p OutputPaths) Paths() Paths {
628: func (p WritablePaths) Paths() Paths {
1319: func (p InstallPaths) Paths() Paths {
46: type ModuleInstallPathContext interface {
80: func reportPathError(ctx PathContext, err error) {
87: func reportPathErrorf(ctx PathContext, format string, args ...interface{}) {
134: type genPathProvider interface {
135: 	genPathWithExt(ctx ModuleContext, subdir, ext string) ModuleGenPath
137: type objPathProvider interface {
138: 	objPathWithExt(ctx ModuleContext, subdir, ext string) ModuleObjPath
140: type resPathProvider interface {
141: 	resPathWithName(ctx ModuleContext, name string) ModuleResPath
146: func GenPathWithExt(ctx ModuleContext, subdir string, p Path, ext string) ModuleGenPath {
156: func ObjPathWithExt(ctx ModuleContext, subdir string, p Path, ext string) ModuleObjPath {
167: func ResPathWithName(ctx ModuleContext, p Path, name string) ModuleResPath {
227: func ExistentPathsForSources(ctx PathContext, paths []string) Paths {
268: type OutputPaths []OutputPath
472: func FirstUniquePaths(list Paths) Paths {
489: func LastUniquePaths(list Paths) Paths {
506: func ReversePaths(list Paths) Paths {
517: func indexPathList(s Path, list []Path) int {
527: func inPathList(p Path, list []Path) bool {
531: func FilterPathList(list []Path, filter []Path) (remainder []Path, filtered []Path) {
535: func FilterPathListPredicate(list []Path, predicate func(Path) bool) (remainder []Path, filtered []Path) {
583: type DirectorySortedPaths Paths
613: type WritablePaths []WritablePath
684: func safePathForSource(ctx PathContext, pathComponents ...string) (SourcePath, error) {
771: func ExistentPathForSource(ctx PathContext, pathComponents ...string) OptionalPath {
1009: func OptionalPathForModuleSrc(ctx ModuleContext, p *string) OptionalPath {
1016: func (p SourcePath) genPathWithExt(ctx ModuleContext, subdir, ext string) ModuleGenPath {
1020: func (p SourcePath) objPathWithExt(ctx ModuleContext, subdir, ext string) ModuleObjPath {
1024: func (p SourcePath) resPathWithName(ctx ModuleContext, name string) ModuleResPath {
1036: func (p ModuleOutPath) objPathWithExt(ctx ModuleContext, subdir, ext string) ModuleObjPath {
1118: func (p ModuleGenPath) genPathWithExt(ctx ModuleContext, subdir, ext string) ModuleGenPath {
1123: func (p ModuleGenPath) objPathWithExt(ctx ModuleContext, subdir, ext string) ModuleObjPath {
1316: type InstallPaths []InstallPath
1417: type testPathContext struct {
21: 	"path/filepath"
33: // Path methods.
107: 	// Returns the path in string form
110: 	// Ext returns the extension of the last element of the path
113: 	// Base returns the last element of the path
116: 	// Rel returns the portion of the path relative to the directory it was created from.  For
117: 	// example, Rel on a PathsForModuleSrc would return the path relative to the module source
122: // WritablePath is a type of path that can be used as an output for build rules.
124: 	Path
126: 	// return the path to the build directory.
144: // GenPathWithExt derives a new file path in ctx's generated sources directory
145: // from the current path, but with the new extension.
147: 	if path, ok := p.(genPathProvider); ok {
148: 		return path.genPathWithExt(ctx, subdir, ext)
150: 	reportPathErrorf(ctx, "Tried to create generated file from unsupported path: %s(%s)", reflect.TypeOf(p).Name(), p)
154: // ObjPathWithExt derives a new file path in ctx's object directory from the
155: // current path, but with the new extension.
157: 	if path, ok := p.(objPathProvider); ok {
158: 		return path.objPathWithExt(ctx, subdir, ext)
160: 	reportPathErrorf(ctx, "Tried to create object file from unsupported path: %s (%s)", reflect.TypeOf(p).Name(), p)
164: // ResPathWithName derives a new path in ctx's output resource directory, using
165: // the current path to create the directory name, and the `name` argument for
168: 	if path, ok := p.(resPathProvider); ok {
169: 		return path.resPathWithName(ctx, name)
171: 	reportPathErrorf(ctx, "Tried to create res file from unsupported path: %s (%s)", reflect.TypeOf(p).Name(), p)
175: // OptionalPath is a container that may or may not contain a valid Path.
181: // OptionalPathForPath returns an OptionalPath containing the path.
183: 	if path == nil {
186: 	return OptionalPath{valid: true, path: path}
189: // Valid returns whether there is a valid path
194: // Path returns the Path embedded in this OptionalPath. You must be sure that
195: // there is a valid path, since this method will panic if there is not.
198: 		panic("Requesting an invalid path")
200: 	return p.path
203: // String returns the string version of the Path, or "" if it isn't valid.
206: 		return p.path.String()
212: // Paths is a slice of Path objects, with helpers to operate on the collection.
218: 	for i, path := range paths {
219: 		ret[i] = PathForSource(ctx, path)
229: 	for _, path := range paths {
230: 		p := ExistentPathForSource(ctx, path)
232: 			ret = append(ret, p.Path())
241: // `android:"path"` so that dependencies on SourceFileProducer modules will have already been handled by the
242: // path_properties mutator.  If ctx.Config().AllowMissingDependencies() is true then any missing SourceFile...(11 bytes skipped)...
251: // argument must have been annotated with struct tag `android:"path"` so that dependencies on SourceFileProducer modules
252: // will have already been handled by the path_properties mutator.  If ctx.Config().AllowMissingDependencies() is
261: 			ctx.ModuleErrorf(`missing dependency on %q, is the property annotated with android:"path"?`, m)
276: 	for i, path := range p {
277: 		ret[i] = path
288: 	for i, path := range p {
289: 		ret[i] = path.String()
298: // `android:"path"` so that dependencies on SourceFileProducer modules will have already been handled by the
299: // path_properties mutator.  If ctx.Config().AllowMissingDependencies() is true then any missing SourceFile...(11 bytes skipped)...
322: 					ctx.ModuleErrorf("path dependency %q: %s", e, err)
326: 				ctx.ModuleErrorf("path dependency %q is not an output file producing module", e)
330: 				ctx.ModuleErrorf("path dependency %q is not a source file producing module", e)
374: 				return nil, fmt.Errorf("path dependency %q: %s", s, err)
378: 			return nil, fmt.Errorf("path dependency %q is not an output file producing module", s)
391: 			return nil, fmt.Errorf("path dependency %q is not a source file producing module", s)
401: 			reportPathErrorf(ctx, "module source path %q does not exist", p)
427: 		path := filepath.Clean(p)
428: 		if !strings.HasPrefix(path, prefix) {
429: 			reportPathErrorf(ctx, "Path %q is not in module source directory %q", p, prefix)
433: 		srcPath, err := safePathForSource(ctx, ctx.ModuleDir(), path[len(prefix):])
439: 		srcPath.basePath.rel = srcPath.path
454: 	path := filepath.Join(ctx.Config().srcDir, ctx.ModuleDir(), def)
455: 	return ctx.Glob(path, nil)
464: 	for i, path := range p {
465: 		ret[i] = path.String()
532: 	return FilterPathListPredicate(list, func(p Path) bool { return inPathList(p, filter) })
549: 	for _, path := range p {
550: 		if path.Ext() == ext {
561: 	for _, path := range p {
562: 		if path.Ext() == ext {
563: 			ret = append(ret, path)
572: 	for _, path := range p {
573: 		if path.Ext() != ext {
574: 			ret = append(ret, path)
621: 	for i, path := range p {
622: 		ret[i] = path.String()
633: 	for i, path := range p {
634: 		ret[i] = path
646: 	return filepath.Ext(p.path)
650: 	return filepath.Base(p.path)
657: 	return p.path
661: 	return p.path
665: 	p.path = filepath.Join(p.path, rel)
670: // SourcePath is a Path representing a file path rooted from SrcDir
675: var _ Path = SourcePath{}
691: 	// absolute path already checked by validateSafePath
693: 		return ret, fmt.Errorf("source path %q is in output", ret.String())
707: 	// absolute path already checked by validatePath
709: 		return ret, fmt.Errorf("source path %q is in output", ret.String())
715: // existsWithDependencies returns true if the path exists, and adds appropriate dependencies to rerun if the
716: // path does not exist.
717: func existsWithDependencies(ctx PathContext, path SourcePath) (exists bool, err error) {
723: 		files, err = gctx.GlobWithDeps(path.String(), nil)
728: 		files, deps, err = ctx.Config().fs.Glob(path.String(), nil, pathtools.FollowSymlinks)
739: // PathForSource joins the provided path components and validates that the result
743: 	path, err := pathForSource(ctx, pathComponents...)
748: 	if pathtools.IsGlob(path.String()) {
749: 		reportPathErrorf(ctx, "path may not contain a glob: %s", path.String())
753: 		exists, err := existsWithDependencies(ctx, path)
758: 			modCtx.AddMissingDependencies([]string{path.String()})
760: 	} else if exists, _, err := ctx.Config().fs.Exists(path.String()); err != nil {
761: 		reportPathErrorf(ctx, "%s: %s", path, err.Error())
763: 		reportPathErrorf(ctx, "source path %q does not exist", path)
765: 	return path
769: // path exists, or an empty OptionalPath if it doesn't exist. Dependencies are added
770: // so that the ninja file will be regenerated if the state of the path changes.
772: 	path, err := pathForSource(ctx, pathComponents...)
778: 	if pathtools.IsGlob(path.String()) {
779: 		reportPathErrorf(ctx, "path may not contain a glob: %s", path.String())
783: 	exists, err := existsWithDependencies(ctx, path)
791: 	return OptionalPathForPath(path)
795: 	return filepath.Join(p.config.srcDir, p.path)
798: // Join creates a new SourcePath with paths... joined with the current path. The
799: // provided paths... may not use '..' to escape from the current path.
801: 	path, err := validatePath(paths...)
805: 	return p.withRel(path)
808: // join is like Join but does less path validation.
810: 	path, err := validateSafePath(paths...)
814: 	return p.withRel(path)
817: // OverlayPath returns the overlay for `path' if it exists. This assumes that the
818: // SourcePath is the path to a resource overlay directory.
821: 	if srcPath, ok := path.(SourcePath); ok {
822: 		relDir = srcPath.path
824: 		reportPathErrorf(ctx, "Cannot find relative path for %s(%s)", reflect.TypeOf(path).Name(), path)
827: 	dir := filepath.Join(p.config.srcDir, p.path, relDir)
830: 		reportPathErrorf(ctx, "Path may not contain a glob: %s", dir)
844: // OutputPath is a Path representing an intermediates file path rooted from the build directory
857: 	p.basePath.rel = filepath.Base(p.basePath.path)
865: var _ Path = OutputPath{}
872: 	path, err := validatePath(pathComponents...)
876: 	fullPath := filepath.Join(ctx.Config().buildDir, path)
877: 	path = fullPath[len(fullPath)-len(path):]
878: 	return OutputPath{basePath{path, ctx.Config(), ""}, fullPath}
884: 	for i, path := range paths {
885: 		ret[i] = PathForOutput(ctx, path)
896: // Join creates a new OutputPath with paths... joined with the current path. The
897: // provided paths... may not use '..' to escape from the current path.
899: 	path, err := validatePath(paths...)
903: 	return p.withRel(path)
911: 	ret := PathForOutput(ctx, pathtools.ReplaceExtension(p.path, ext))
918: 	path, err := validatePath(paths...)
923: 	ret := PathForOutput(ctx, filepath.Dir(p.path), path)
924: 	ret.rel = filepath.Join(filepath.Dir(p.rel), path)
931: 	path, err := validatePath(paths...)
935: 	return PathForOutput(ctx, ".intermediates", path)
942: // PathForModuleSrc returns a Path representing the paths... under the
955: 				ctx.ModuleErrorf(`%s, is the property annotated with android:"path"?`, depErr.Error())
976: 	path, err := pathForSource(ctx, ctx.ModuleDir(), p)
981: 	path.basePath.rel = p
983: 	return path
986: // PathsWithModuleSrcSubDir takes a list of Paths and returns a new list of Paths where Rel() on each path
987: // will return the path relative to subDir in the module's source directory.  If any input paths are not located
988: // inside subDir then a path error will be reported.
992: 	for i, path := range paths {
993: 		rel := Rel(ctx, subDirFullPath.String(), path.String())
999: // PathWithModuleSrcSubDir takes a Path and returns a Path where Rel() will return the path relative to subDir in the
1000: // module's source directory.  If the input path is not located inside subDir then a path error will be reported.
1003: 	rel := Rel(ctx, subDirFullPath.String(), path.String())
1008: // valid path if p is non-nil.
1017: 	return PathForModuleGen(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1021: 	return PathForModuleObj(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1026: 	return PathForModuleRes(ctx, p.path, name)
1029: // ModuleOutPath is a Path representing a module's output directory.
1034: var _ Path = ModuleOutPath{}
1037: 	return PathForModuleObj(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1044: // PathForVndkRefAbiDump returns an OptionalPath representing the path of the
1082: // PathForModuleOut returns a Path representing the paths... under the module's
1094: // ModuleGenPath is a Path representing the 'gen' directory in a module's output
1100: var _ Path = ModuleGenPath{}
1104: // PathForModuleGen returns a Path representing the paths... under the module's
1119: 	// TODO: make a different path for local vs remote generated files?
1120: 	return PathForModuleGen(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1124: 	return PathForModuleObj(ctx, subdir, pathtools.ReplaceExtension(p.path, ext))
1127: // ModuleObjPath is a Path representing the 'obj' directory in a module's output
1133: var _ Path = ModuleObjPath{}
1135: // PathForModuleObj returns a Path representing the paths... under the module's
1145: // ModuleResPath is a a Path representing the 'res' directory in a module's
1151: var _ Path = ModuleResPath{}
1153: // PathForModuleRes returns a Path representing the paths... under the module's
1164: // InstallPath is a Path representing a installed file path rooted from the build directory
1175: var _ Path = InstallPath{}
1181: 	return filepath.Join(p.config.buildDir, p.baseDir, p.path)
1184: // Join creates a new InstallPath with paths... joined with the current path. The
1185: // provided paths... may not use '..' to escape from the current path.
1187: 	path, err := validatePath(paths...)
1191: 	return p.withRel(path)
1206: // PathForModuleInstall returns a Path representing the install path for the
1247: 	path, err := validatePath(outPaths...)
1252: 	ret := InstallPath{basePath{path, ctx.Config(), ""}, ""}
1259: 	path, err := validatePath(paths...)
1263: 	return InstallPath{basePath{path, ctx.Config(), ""}, ""}
1267: 	rel := Rel(ctx, PathForOutput(ctx, "target", "product", ctx.Config().DeviceName()).String(), path.String())
1324: 	for i, path := range p {
1325: 		ret[i] = path
1336: 	for i, path := range p {
1337: 		ret[i] = path.String()
1342: // validateSafePath validates a path that we trust (may contain ninja variables).
1343: // Ensures that each path component does not attempt to leave its component.
1345: 	for _, path := range pathComponents {
1346: 		path := filepath.Clean(path)
1347: 		if path == ".." || strings.HasPrefix(path, "../") || strings.HasPrefix(path, "/") {
1348: 			return "", fmt.Errorf("Path is outside directory: %s", path)
1357: // validatePath validates that a path does not include ninja variables, and that
1358: // each path component does not attempt to leave its component. Returns a joined
1359: // version of each path component.
1361: 	for _, path := range pathComponents {
1362: 		if strings.Contains(path, "$") {
1363: 			return "", fmt.Errorf("Path contains invalid character($): %s", path)
1386: var _ Path = PhonyPath{}
1394: 	return p.path
1397: // PathForTesting returns a Path constructed from joining the elements of paths with '/'.  It should only be used from
1404: 	return testPath{basePath{path: p, rel: p}}
1407: // PathsForTesting returns a Path constructed from each element in strs. It should only be used from within tests.
1437: 		reportPathErrorf(ctx, "path %q is not under path %q", targetPath, basePath)
1454: 	// filepath.Rel returns an error if one path is absolute and the other is not, handle that case first.
1469: func WriteFileToOutputDir(path WritablePath, data []byte, perm os.FileMode) error {
1470: 	return ioutil.WriteFile(absolutePath(path.String()), data, perm)
1474: 	if filepath.IsAbs(path) {
1475: 		return path
1477: 	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)
118: 	// directory, and OutputPath.Join("foo").Rel() would return "foo".
129: 	// the writablePath method doesn't directly do anything,
130: 	// but it allows a struct to distinguish between whether or not it implements the WritablePath interface
151: 	return PathForModuleGen(ctx)
161: 	return PathForModuleObj(ctx)
172: 	return PathForModuleRes(ctx)
184: 		return OptionalPath{}
190: func (p OptionalPath) Valid() bool {
204: func (p OptionalPath) String() string {
215: // PathsForSource returns Paths rooted from SrcDir
217: 	ret := make(Paths, len(paths))
224: // ExistentPathsForSources returns a list of Paths rooted from SrcDir that are
228: 	ret := make(Paths, 0, len(paths))
238: // PathsForModuleSrc returns Paths rooted from the module's local source directory.  It expands globs, references to
240: // ":name{.tag}" syntax.  Properties passed as the paths argument must have been annotated with struct tag
245: 	return PathsForModuleSrcExcludes(ctx, paths, nil)
248: // PathsForModuleSrcExcludes returns Paths rooted from the module's local source directory, excluding paths listed in
250: ...(2 bytes skipped)... references to OutputFileProducer modules using the ":name{.tag}" syntax.  Properties passed as the paths or excludes
256: 	ret, missingDeps := PathsAndMissingDepsForModuleSrcExcludes(ctx, paths, excludes)
267: // OutputPaths is a slice of OutputPath objects, with helpers to operate on the collection.
270: // Paths returns the OutputPaths as a Paths
275: 	ret := make(Paths, len(p))
282: // Strings returns the string forms of the writable paths.
294: // PathsAndMissingDepsForModuleSrcExcludes returns Paths rooted from the module's local source directory, excluding
295: // paths listed in the excludes arguments, and a list of missing dependencies.  It expands globs, reference...(4 bytes skipped)...
297: // ":name{.tag}" syntax.  Properties passed as the paths or excludes argument must have been annotated with struct tag
303: 	prefix := pathForModuleSrc(ctx).String()
333: 			expandedExcludes = append(expandedExcludes, filepath.Join(prefix, e))
337: 	if paths == nil {
343: 	expandedSrcFiles := make(Paths, 0, len(paths))
344: 	for _, s := range paths {
345: 		srcFiles, err := expandOneSrcPath(ctx, s, expandedExcludes)
393: 	} else if pathtools.IsGlob(s) {
394: 		paths := ctx.GlobFiles(pathForModuleSrc(ctx, s).String(), expandedExcludes)
395: 		return PathsWithModuleSrcSubDir(ctx, paths, ""), nil
397: 		p := pathForModuleSrc(ctx, s)
408: 		return Paths{p}, nil
412: // pathsForModuleSrcFromFullPath returns Paths rooted from the module's local
414: // each string. If incDirs is false, strip paths with a trailing '/' from the list.
418: 	prefix := filepath.Join(ctx.Config().srcDir, ctx.ModuleDir()) + "/"
422: 	ret := make(Paths, 0, len(paths))
423: 	for _, p := range paths {
441: 		ret = append(ret, srcPath)
446: // PathsWithOptionalDefaultForModuleSrc returns Paths rooted from the module's
450: 		return PathsForModuleSrc(ctx, input)
458: // Strings returns the Paths in string form
459: func (p Paths) Strings() []string {
470: // FirstUniquePaths returns all unique elements of a Paths, keeping the first copy of each.  It
471: // modifies the Paths slice contents in place, and returns a subslice of the original slice.
487: // LastUniquePaths returns all unique elements of a Paths, keeping the last copy of each.  It
488: // modifies the Paths slice contents in place, and returns a subslice of the original slice.
505: // ReversePaths returns a copy of a Paths in reverse order.
510: 	ret := make(Paths, len(list))
547: // HasExt returns true of any of the paths have extension ext, otherwise false
548: func (p Paths) HasExt(ext string) bool {
558: // FilterByExt returns the subset of the paths that have extension ext
559: func (p Paths) FilterByExt(ext string) Paths {
560: 	ret := make(Paths, 0, len(p))
569: // FilterOutByExt returns the subset of the paths that do not have extension ext
570: func (p Paths) FilterOutByExt(ext string) Paths {
571: 	ret := make(Paths, 0, len(p))
580: // DirectorySortedPaths is a slice of paths that are sorted such that all files in a directory
586: 	ret := append(DirectorySortedPaths(nil), paths...)
593: // PathsInDirectory returns a subslice of the DirectorySortedPaths as a Paths that contains all entries
596: 	prefix := filepath.Clean(dir) + "/"
609: 	return Paths(ret)
615: // Strings returns the string forms of the writable paths.
627: // Paths returns the WritablePaths as a Paths
632: 	ret := make(Paths, len(p))
645: func (p basePath) Ext() string {
649: func (p basePath) Base() string {
653: func (p basePath) Rel() string {
660: func (p basePath) String() string {
664: func (p basePath) withRel(rel string) basePath {
677: func (p SourcePath) withRel(rel string) SourcePath {
678: 	p.basePath = p.basePath.withRel(rel)
682: // safePathForSource is for paths that we expect are safe -- only for use by go
683: // code that is embedding ninja variables in paths
685: 	p, err := validateSafePath(pathComponents...)
686: 	ret := SourcePath{basePath{p, ctx.Config(), ""}}
699: // pathForSource creates a SourcePath from pathComponents, but does not check that it exists.
701: 	p, err := validatePath(pathComponents...)
702: 	ret := SourcePath{basePath{p, ctx.Config(), ""}}
720: 	if gctx, ok := ctx.(PathGlobContext); ok {
741: // On error, it will return a usable, but invalid SourcePath, and report a ModuleError.
768: // ExistentPathForSource returns an OptionalPath with the SourcePath if the
775: 		return OptionalPath{}
780: 		return OptionalPath{}
786: 		return OptionalPath{}
789: 		return OptionalPath{}
794: func (p SourcePath) String() string {
800: func (p SourcePath) Join(ctx PathContext, paths ...string) SourcePath {
809: func (p SourcePath) join(ctx PathContext, paths ...string) SourcePath {
825: 		return OptionalPath{}
829: 	if pathtools.IsGlob(dir) {
832: 	paths, err := ctx.GlobWithDeps(dir, nil)
835: 		return OptionalPath{}
837: 	if len(paths) == 0 {
838: 		return OptionalPath{}
840: 	relPath := Rel(ctx, p.config.srcDir, paths[0])
841: 	return OptionalPathForPath(PathForSource(ctx, relPath))
850: func (p OutputPath) withRel(rel string) OutputPath {
851: 	p.basePath = p.basePath.withRel(rel)
852: 	p.fullPath = filepath.Join(p.fullPath, rel)
856: func (p OutputPath) WithoutRel() OutputPath {
861: func (p OutputPath) buildDir() string {
866: var _ WritablePath = OutputPath{}
868: // PathForOutput joins the provided paths and returns an OutputPath that is
870: // On error, it will return a usable, but invalid OutputPath, and report a ModuleError.
881: // PathsForOutput returns Paths rooted from buildDir
883: 	ret := make(WritablePaths, len(paths))
892: func (p OutputPath) String() string {
893: 	return p.fullPath
898: func (p OutputPath) Join(ctx PathContext, paths ...string) OutputPath {
906: // ReplaceExtension creates a new OutputPath with the extension replaced with ext.
907: func (p OutputPath) ReplaceExtension(ctx PathContext, ext string) OutputPath {
912: 	ret.rel = pathtools.ReplaceExtension(p.rel, ext)
916: // InSameDir creates a new OutputPath from the directory of the current OutputPath joined with the elements in paths.
917: func (p OutputPath) InSameDir(ctx PathContext, paths ...string) OutputPath {
928: // PathForIntermediates returns an OutputPath representing the top-level
938: var _ genPathProvider = SourcePath{}
939: var _ objPathProvider = SourcePath{}
940: var _ resPathProvider = SourcePath{}
945: 	p, err := validatePath(pathComponents...)
949: 	paths, err := expandOneSrcPath(ctx, p, nil)
961: 	} else if len(paths) == 0 {
964: 	} else if len(paths) > 1 {
965: 		reportPathErrorf(ctx, "%q produced %d files, expected exactly one", p, len(paths))
967: 	return paths[0]
971: 	p, err := validatePath(paths...)
990: 	paths = append(Paths(nil), paths...)
991: 	subDirFullPath := pathForModuleSrc(ctx, subDir)
994: 		paths[i] = subDirFullPath.join(ctx, rel)
996: 	return paths
1002: 	subDirFullPath := pathForModuleSrc(ctx, subDir)
1004: 	return subDirFullPath.Join(ctx, rel)
1007: // OptionalPathForModuleSrc returns an OptionalPath. The OptionalPath contains a
1011: 		return OptionalPath{}
1013: 	return OptionalPathForPath(PathForModuleSrc(ctx, *p))
1041: 	return PathForOutput(ctx, ".intermediates", ctx.ModuleDir(), ctx.ModuleName(), ctx.ModuleSubDir())
1047: 	isNdk, isLlndkOrVndk, isGzip bool) OptionalPath {
1085: 	p, err := validatePath(paths...)
1089: 	return ModuleOutPath{
1090: 		OutputPath: pathForModule(ctx).withRel(p),
1101: var _ genPathProvider = ModuleGenPath{}
1102: var _ objPathProvider = ModuleGenPath{}
1107: 	p, err := validatePath(paths...)
1111: 	return ModuleGenPath{
1112: 		ModuleOutPath: ModuleOutPath{
1113: 			OutputPath: pathForModule(ctx).withRel("gen").withRel(p),
1138: 	p, err := validatePath(pathComponents...)
1142: 	return ModuleObjPath{PathForModuleOut(ctx, "obj", p)}
1156: 	p, err := validatePath(pathComponents...)
1161: 	return ModuleResPath{PathForModuleOut(ctx, "res", p)}
1168: 	baseDir string // "../" for Make paths to convert "out/soong" to "out", "" for Soong paths
1171: func (p InstallPath) buildDir() string {
1176: var _ WritablePath = InstallPath{}
1180: func (p InstallPath) String() string {
1186: func (p InstallPath) Join(ctx PathContext, paths ...string) InstallPath {
1194: func (p InstallPath) withRel(rel string) InstallPath {
1195: 	p.basePath = p.basePath.withRel(rel)
1199: // ToMakePath returns a new InstallPath that points to Make's install directory instead of Soong's,
1207: // module appended with paths...
1215: 	ret := pathForInstall(ctx, os, partition, ctx.Debug(), pathComponents...)
1218: 		ret = ret.ToMakePath()
1225: 	pathComponents ...string) InstallPath {
1245: 	outPaths = append(outPaths, pathComponents...)
1258: 	paths = append([]string{"ndk"}, paths...)
1297: 			partition = ctx.DeviceConfig().VendorPath()
1299: 			partition = ctx.DeviceConfig().OdmPath()
1301: 			partition = ctx.DeviceConfig().ProductPath()
1303: 			partition = ctx.DeviceConfig().SystemExtPath()
1318: // Paths returns the InstallPaths as a Paths
1323: 	ret := make(Paths, len(p))
1330: // Strings returns the string forms of the install paths.
1351: 	// TODO: filepath.Join isn't necessarily correct with embedded ninja
1354: 	return filepath.Join(pathComponents...), nil
1366: 	return validateSafePath(pathComponents...)
1373: 	return PhonyPath{basePath{phony, ctx.Config(), ""}}
1382: func (p PhonyPath) buildDir() string {
1387: var _ WritablePath = PhonyPath{}
1393: func (p testPath) String() string {
1400: 	p, err := validateSafePath(paths...)
1409: 	p := make(Paths, len(strs))
1411: 		p[i] = PathForTesting(s)
1424: // PathContextForTesting returns a PathContext that can be used in tests, for example to create an OutputPath with
1425: // PathForOutput.
1432: // Rel performs the same function as filepath.Rel, but reports errors to a PathContext, and reports an error if
1433: // targetPath is not inside basePath.
1434: func Rel(ctx PathContext, basePath string, targetPath string) string {
1435: 	rel, isRel := MaybeRel(ctx, basePath, targetPath)
1443: // MaybeRel performs the same function as filepath.Rel, but reports errors to a PathContext, and returns false if
1444: // targetPath is not inside basePath.
1445: func MaybeRel(ctx PathContext, basePath string, targetPath string) (string, bool) {
1446: 	rel, isRel, err := maybeRelErr(basePath, targetPath)
1453: func maybeRelErr(basePath string, targetPath string) (string, bool, error) {
1455: 	if filepath.IsAbs(basePath) != filepath.IsAbs(targetPath) {
1458: 	rel, err := filepath.Rel(basePath, targetPath)
59: var _ ModuleInstallPathContext = ModuleContext(nil)
77: // reportPathError will register an error with the attached context. It
81: 	reportPathErrorf(ctx, "%s", err.Error())
84: // reportPathErrorf will register an error with the attached context. It
283: func (p OutputPaths) Strings() []string {
349: 			reportPathError(ctx, err)
399: 			reportPathErrorf(ctx, "%s: %s", p, err.Error())
435: 			reportPathError(ctx, err)
528: 	return indexPathList(p, list) != -1
612: // WritablePaths is a slice of WritablePaths, used for multiple outputs.
616: func (p WritablePaths) Strings() []string {
745: 		reportPathError(ctx, err)
755: 			reportPathError(ctx, err)
774: 		reportPathError(ctx, err)
785: 		reportPathError(ctx, err)
803: 		reportPathError(ctx, err)
812: 		reportPathError(ctx, err)
834: 		reportPathErrorf(ctx, "glob: %s", err.Error())
874: 		reportPathError(ctx, err)
901: 		reportPathError(ctx, err)
909: 		reportPathErrorf(ctx, "extension %q cannot contain /", ext)
920: 		reportPathError(ctx, err)
933: 		reportPathError(ctx, err)
947: 		reportPathError(ctx, err)
958: 			reportPathError(ctx, err)
962: 		reportPathErrorf(ctx, "%q produced no files, expected exactly one", p)
973: 		reportPathError(ctx, err)
978: 		reportPathError(ctx, err)
1077: 	return ExistentPathForSource(ctx, "prebuilts", "abi-dumps", dirName,
1087: 		reportPathError(ctx, err)
1109: 		reportPathError(ctx, err)
1140: 		reportPathError(ctx, err)
1158: 		reportPathError(ctx, err)
1189: 		reportPathError(ctx, err)
1227: 	var outPaths []string
1230: 		outPaths = []string{"target", "product", ctx.Config().DeviceName(), partition}
1234: 			outPaths = []string{"host", "linux-x86", partition}
1237: 			outPaths = []string{"host", "linux_bionic-x86", partition}
1239: 			outPaths = []string{"host", os.String() + "-x86", partition}
1243: 		outPaths = append([]string{"debug"}, outPaths...)
1249: 		reportPathError(ctx, err)
1261: 		reportPathError(ctx, err)
1272: func modulePartition(ctx ModuleInstallPathContext, os OsType) string {
1331: func (p InstallPaths) Strings() []string {
1371: 		reportPathErrorf(ctx, "Phony target contains invalid character ($ or /): %s", phony)
1421: func (x *testPathContext) Config() Config             { return x.config }
1422: func (x *testPathContext) AddNinjaFileDeps(...string) {}
1427: 	return &testPathContext{
1448: 		reportPathError(ctx, err)
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;
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)
81:         with open(self._path, "rb") as file_handler:
85:         with open(self._path, "wb") as file_handler:
89:         for p in os.listdir(self._path):
90:             yield Path(os.path.join(self._path, p))
94:         _, ext = os.path.splitext(self.name)
99:         base, _ = os.path.splitext(self.name)
104:         with open(self._path, mode) as file_handler:
112:             result.append(Path(os.sep.join(parts[0 : i + 1])))
116:         os.remove(self._path)
122:         return os.path.islink(self._path)
125:         if not self._path.startswith(other._path):
126:             raise ValueError("{} does not start with {}".format(self._path, other._path))
127:         return Path(os.sep.join(self.parts[len(other.parts) :]))
130:         return os.stat(self._path)
133:         os.chmod(self._path, mode)
136: __all__ = ("Path",)
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/build/soong:android/paths.go: [ master, ] Duplicate result
github.com/google/go-cmp:cmp/path.go: [ master, ]
26: type Path []PathStep
34: type PathStep interface {
151: type pathStep struct {
172: 	pathStep
210: 	pathStep
255: 	pathStep
269: 	pathStep
279: 	pathStep
289: 	pathStep
334: 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 {
328: // Path for whether px was ever encountered in the Path history of x, and
333: // 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 {
307: // pointerPath represents a dual-stack of pointers encountered when
312: // The pointerPath uses a map to represent a stack; where descension into a
330: // equal if both px and py have a cycle resulting from the same PathStep.
341: func (p *pointerPath) Init() {
353: func (p pointerPath) Push(vx, vy reflect.Value) (equal, visited bool) {
368: func (p pointerPath) Pop(vx, vy reflect.Value) {
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 */
1007: gegl_path_get_path (GeglPath *path)
1015: gegl_path_get_flat_path (GeglPath *path)
1721: #define GEGL_PARAM_PATH(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEGL_TYPE_PARAM_PATH, GeglParamPath))
1771: gegl_param_spec_path   (const gchar *name,
1724: typedef struct _GeglParamPath GeglParamPath;
1726: 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)
265: gegl_path_new (void)
272: gegl_path_new_from_string (const gchar *path_string)
280: gegl_path_is_empty (GeglPath *path)
287: gegl_path_get_n_nodes  (GeglPath *vector)
304: gegl_path_get_length (GeglPath *self)
320: gegl_path_get_node (GeglPath     *vector,
350: gegl_path_to_string (GeglPath  *vector)
401: gegl_path_set_matrix (GeglPath    *path,
416: void gegl_path_get_matrix (GeglPath    *path,
424: gegl_path_closest_point (GeglPath *path,
516: gegl_path_calc (GeglPath   *self,
561: gegl_path_calc_values (GeglPath *self,
574: gegl_path_get_bounds (GeglPath *self,
636: gegl_path_foreach (GeglPath     *vector,
653: gegl_path_foreach_flat (GeglPath     *vector,
671: gegl_path_clear (GeglPath *vector)
681: gegl_path_insert_node (GeglPath           *vector,
727: gegl_path_replace_node (GeglPath           *vector,
762: gegl_path_remove_node (GeglPath *vector,
796: gegl_path_dirty (GeglPath *path)
805: gegl_path_parse_string (GeglPath    *vector,
869: gegl_path_append (GeglPath *self,
950: gegl_path_freeze (GeglPath *path)
957: gegl_path_thaw (GeglPath *path)
965: gegl_path_add_type (gchar        type,
985: gegl_path_add_flattener (GeglPathList *(*flattener) (GeglPathList *original))
1041: gegl_path_emit_changed (GeglPath            *self,
1318: gegl_path_item_free (GeglPathList *p)
1326: gegl_path_list_destroy (GeglPathList *path)
1339: gegl_path_list_append (GeglPathList *head,
1378: gegl_path_list_append_item  (GeglPathList  *head,
1420: gegl_path_list_flatten (GeglMatrix3  *matrix,
1445: gegl_path_list_calc (GeglPathList *path,
1528: gegl_path_list_calc_values (GeglPathList *path,
1605: gegl_path_list_get_length (GeglPathList *path)
1653: gegl_path_point_lerp (GeglPathPoint  *dest,
1663: gegl_path_point_dist (GeglPathPoint *a,
1672: gint gegl_path_calc_y_for_x (GeglPath *path,
1722: #define GEGL_IS_PARAM_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEGL_TYPE_PARAM_PATH))
1746: 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] =
223:   GeglPath        *self = GEGL_PATH (gobject);
224:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (self);
227:   if (priv->path)
228:     gegl_path_list_destroy (priv->path);
229:   if (priv->flat_path)
230:     gegl_path_list_destroy (priv->flat_path);
233:   G_OBJECT_CLASS (gegl_path_parent_class)->finalize (gobject);
267:   return g_object_new (GEGL_TYPE_PATH,
274:   GeglPath *self = gegl_path_new ();
275:   gegl_path_parse_string (self, path_string);
282:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (path);
283:   return priv->path == NULL;
294:   priv = GEGL_PATH_GET_PRIVATE (vector);
296:   for (iter = priv->path; iter; iter=iter->next)
306:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (self);
313:       priv->length = gegl_path_list_get_length (priv->flat_path);
324:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
328:   for (iter = priv->path; iter; iter=iter->next)
359:   priv = GEGL_PATH_GET_PRIVATE (vector);
360:   for (iter = priv->path; iter; iter=iter->next)
405:   if (!path)
407:       g_warning ("EEek! no path\n");
410:   priv = GEGL_PATH_GET_PRIVATE (path);
412:   priv->flat_path_clean = FALSE;
419:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (path);
431:   gdouble length = gegl_path_get_length (path);
451:   gegl_path_calc_values (path, n, samples_x, samples_y);
483:       GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (path);
487:       for (iter=priv->path,i=0; iter;i++,iter=iter->next)
492:           dist = gegl_path_closest_point (path,
521:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (self);
531:   entry = priv->flat_path;
544:   if (gegl_path_list_calc (entry,rel_pos,xd,yd,&stop,&leftover))
566:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (self);
570:   gegl_path_list_calc_values (priv->flat_path, num_samples, xs, ys);
599:   priv = GEGL_PATH_GET_PRIVATE (self);
602:   iter = priv->flat_path;
645:   priv = GEGL_PATH_GET_PRIVATE (vector);
646:   for (iter = priv->path; iter; iter=iter->next)
662:   priv = GEGL_PATH_GET_PRIVATE (vector);
664:   for (iter = priv->flat_path; iter; iter=iter->next)
673:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
674:   if (priv->path)
675:     gegl_path_list_destroy (priv->path);
676:   priv->path = NULL;
685:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
691:   for (iter = priv->path; iter; iter=iter->next)
702:           priv->flat_path_clean = FALSE;
704:           gegl_path_emit_changed (vector, NULL);
719:         priv->path = new;
721:   priv->flat_path_clean = FALSE;
723:   gegl_path_emit_changed (vector, NULL);
731:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
736:   for (iter = priv->path; iter; iter=iter->next)
742:           priv->flat_path_clean = FALSE;
745:           gegl_path_emit_changed (vector, NULL);
756:   priv->flat_path_clean = FALSE;
758:   gegl_path_emit_changed (vector, NULL);
765:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
772:     pos = gegl_path_get_n_nodes (vector)-1;
774:   for (iter = priv->path; iter; iter=iter->next)
781:             priv->path = iter->next;
782:           gegl_path_item_free (iter);
789:   priv->flat_path_clean = FALSE;
792:   gegl_path_emit_changed (vector, NULL);
798:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (path);
799:   priv->flat_path_clean = FALSE;
801:   gegl_path_emit_changed (path, NULL);
806:                         const gchar *path)
808:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
809:   const gchar *p = path;
837:                 priv->path = gegl_path_list_append (priv->path, type, 0., 0.);
842:                 priv->path = gegl_path_list_append (priv->path, type, x0, y0);
847:                 priv->path = gegl_path_list_append (priv->path, type, x0, y0, x1, y1);
853:                 priv->path = gegl_path_list_append (priv->path, type, x0, y0, x1, y1, x2, y2);
865:   gegl_path_dirty (vector);
879:   priv = GEGL_PATH_GET_PRIVATE (self);
887:   priv->path = gegl_path_list_append_item (priv->path, type, &iter, ensure_tail(priv));
897:   priv->flat_path_clean = FALSE;
901:       /* special case lineto so that the full path doesn't need
911:       for (iter2=priv->path;iter2 && iter2->next != iter && iter2->next;iter2=iter2->next);
940:       gegl_path_emit_changed (self, &rect);
944:       gegl_path_emit_changed (self, NULL);
952:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (path);
959:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (path);
961:   gegl_path_emit_changed (path, NULL); /* expose a full changed */
987:   GeglPath *vector = g_object_new (GEGL_TYPE_PATH, NULL);
988:   GeglPathClass *klass= GEGL_PATH_GET_CLASS (vector);
1009:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (path);
1011:   return priv->path;
1017:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (path);
1019:   ensure_flattened (path);
1020:   return priv->flat_path;
1044:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (self);
1055:   if (! gegl_path_is_empty (self))
1057:       gegl_path_get_bounds (self, &min_x, &max_x, &min_y, &max_y);
1097:   priv->cached_extent_empty = gegl_path_is_empty (self);
1101:       g_signal_emit (self, gegl_path_signals[GEGL_PATH_CHANGED], 0,
1117:   GeglPathPrivate *priv = GEGL_PATH_GET_PRIVATE (vector);
1119:   GeglPathList *path = priv->path;
1120:   GeglPathList *new_path;
1121:   GeglPathList *old_path = NULL;
1122:   GeglPathClass *klass= GEGL_PATH_GET_CLASS (vector);
1124:   if (priv->flat_path_clean)
1126:   if (priv->flat_path)
1127:     old_path = priv->flat_path;
1131:       new_path = klass->flattener[i] (path);
1132:       if (new_path != path)
1134:           if (path != priv->path)
1135:             gegl_path_list_destroy (path);
1136:           path = new_path;
1140:   priv->flat_path = gegl_path_list_flatten (&priv->matrix, path);
1141:   if (old_path)
1142:     gegl_path_list_destroy (old_path);
1143:   if (path != priv->path)
1144:     gegl_path_list_destroy (path);
1145:   priv->flat_path_clean = TRUE;
1154:  * Ensure that priv->tail point to the last element of the path list
1161:   tail = priv->tail ? priv->tail : priv->path;
1187:   head = gegl_path_list_append_item (head, self->d.type, &newp, NULL);
1203:   head = gegl_path_list_append_item (head, self->d.type, &newp, NULL);
1239:       head = gegl_path_list_append (head, 'L', res.x, res.y);
1243:   head = gegl_path_list_append (head, 'L', res.x, res.y);
1307:     gegl_path_point_lerp (&ab, &prev->point[2], &curve->point[0], t);
1309:     gegl_path_point_lerp (&ab, &prev->point[0], &curve->point[0], t);
1310:   gegl_path_point_lerp (&bc, &curve->point[0], &curve->point[1], t);
1311:   gegl_path_point_lerp (&cd, &curve->point[1], &curve->point[2], t);
1312:   gegl_path_point_lerp (&abbc, &ab, &bc,t);
1313:   gegl_path_point_lerp (&bccd, &bc, &cd,t);
1314:   gegl_path_point_lerp (dest, &abbc, &bccd, t);
1328:   GeglPathList *iter = path;
1332:       gegl_path_item_free (iter);
1355:   head = gegl_path_list_append_item (head, type, &iter, NULL);
1368:  * gegl_path_list_append_item:
1398:   else /* creating new path */
1413:  * gegl_path_list_flatten:
1452:   GeglPathList *iter = path, *prev = NULL;
1456:   /* fetch the start point of the path */
1472:   /* travel along the path */
1492:               distance = gegl_path_point_dist (&a, &b);
1500:                   gegl_path_point_lerp (&spot, &a, &b, ratio);
1533:   GeglPathList *iter = path;
1534:   gdouble length = gegl_path_list_get_length (path);
1562:               distance = gegl_path_point_dist (&a, &b);
1570:                   gegl_path_point_lerp (&spot, &a, &b, ratio);
1592:             g_error ("stroking uninitialized path\n");
1607:   GeglPathList *iter = path;
1630:               distance = gegl_path_point_dist (&a, &b);
1687:   gegl_path_calc_values (path, Y_FOR_X_RES, xs, ys);
1740:                                                        GEGL_TYPE_PARAM_PATH));
1761:       param_vector_type_info.value_type = GEGL_TYPE_PATH;
1779:   param_vector = g_param_spec_internal (GEGL_TYPE_PARAM_PATH,
118: static void             ensure_flattened              (GeglPath         *vector);
263: /***** GeglPath *****/
264: GeglPath *
271: GeglPath *
1109:  * @vector: a #GeglPath
1115: ensure_flattened (GeglPath *vector)
1152:  * @priv: the private struct of a GeglPath
1716:  * A GParamSpec class to describe behavior of GeglPath as an object property
1753:         sizeof (GeglParamPath),
1763:       param_vector_type = g_param_type_register_static ("GeglParamPath",
1774:                         GeglPath  *default_vector,
1777:   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;
289:   GeglPathPrivate *priv;
290:   GeglPathList *iter;
322:                     GeglPathItem *node)
325:   GeglPathList *iter;
326:   GeglPathItem *last = NULL;
352:   GeglPathPrivate *priv;
355:   GeglPathList *iter;
404:   GeglPathPrivate *priv;
484:       GeglPathList *iter;
522:   GeglPathList *entry;
523:   GeglPathList *stop  = NULL;
581:   GeglPathPrivate *priv;
582:   GeglPathList    *iter;
637:                    void (*func) (const GeglPathItem *knot,
641:   GeglPathPrivate *priv;
642:   GeglPathList *iter;
654:                         void (*func) (const GeglPathItem *knot,
658:   GeglPathPrivate *priv;
659:   GeglPathList *iter;
683:                        const GeglPathItem *knot)
686:   GeglPathList *iter;
687:   GeglPathList *prev = NULL;
695:           GeglPathList *new = g_slice_alloc0 (sizeof (gpointer) + sizeof (gchar) + sizeof (gfloat)*2 *(info->n_items+3...(5 bytes skipped)...
712:       GeglPathList *new = g_slice_alloc0 (sizeof (gpointer) + sizeof (gchar) + sizeof (gfloat)*2 *(info->n_items+3...(5 bytes skipped)...
729:                         const GeglPathItem *knot)
732:   GeglPathList *iter;
733:   GeglPathList *prev = NULL;
766:   GeglPathList *iter;
767:   GeglPathList *prev = NULL;
872:   GeglPathPrivate *priv;
874:   GeglPathList *iter;
904:       GeglPathList *iter2;
1006: GeglPathList *
1014: GeglPathList *
1156: static GeglPathList *
1157: ensure_tail (GeglPathPrivate *priv)
1159:   GeglPathList *tail;
1171: static GeglPathList *
1173:              GeglPathList *head,
1174:              GeglPathList *prev,
1175:              GeglPathList *self)
1180: static GeglPathList *
1182:               GeglPathList *head,
1183:               GeglPathList *prev,
1184:               GeglPathList *self)
1186:   GeglPathList *newp;
1193: static GeglPathList *
1195:                   GeglPathList *head,
1196:                   GeglPathList *prev,
1197:                   GeglPathList *self)
1199:   GeglPathList *newp;
1222: static GeglPathList *
1224:                GeglPathList *head,
1225:                GeglPathList *prev,
1226:                GeglPathList *self)
1229:   GeglPathPoint res;
1231:   GeglPathItem *item=(void*)buf;
1259: /***** GeglPathItem *****/
1262:                 GeglPathItem *dst)
1279: copy_data (const GeglPathItem *src,
1280:            GeglPathItem       *dst)
1299: bezier2 (GeglPathItem  *prev,
1300:          GeglPathItem  *curve,
1301:          GeglPathPoint *dest,
1304:   GeglPathPoint ab,bc,cd,abbc,bccd;
1324: /***** GeglPathList *****/
1325: GeglPathList *
1331:       GeglPathList *next = iter->next;
1338: GeglPathList *
1343:   GeglPathList *iter;
1377: static GeglPathList *
1380:                              GeglPathList **res,
1381:                              GeglPathList  *tail)
1383:   GeglPathList *iter = tail?tail:head;
1415:  * @original: the #GeglPathList to flatten
1417:  * Flatten the provided GeglPathList
1419: static GeglPathList *
1421:                         GeglPathList *original)
1423:   GeglPathList *iter;
1424:   GeglPathList *self = NULL;
1426:   GeglPathList *endp = NULL;
1449:                      GeglPathList **stop,
1483:               GeglPathPoint a,b;
1497:                   GeglPathPoint spot;
1553:               GeglPathPoint a,b;
1567:                   GeglPathPoint spot;
1621:               GeglPathPoint a,b;
1651: /***** GeglPathPoint *****/
1654:                       GeglPathPoint  *a,
1655:                       GeglPathPoint  *b,
1664:                       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;
881:           && s[0] == slash<path_type>::value
882:           && s[1] == slash<path_type>::value
883:           && s[2] != slash<path_type>::value )
886:             s.find( slash<path_type>::value, 2 ) );
891:         if ( size > 0 && s[0] == slash<path_type>::value ) return 0;
903:           boost::BOOST_FILESYSTEM_NAMESPACE::basic_path<String, Traits>
906:         assert( !str.empty() && str[pos] == slash<path_type>::value
910:         while ( pos > 0 && str[pos-1] == slash<path_type>::value )
914:           && (pos <= 2 || str[1] != slash<path_type>::value
915:             || str.find( slash<path_type>::value, 2 ) != pos)
916: #       ifdef BOOST_WINDOWS_PATH
917:           && (pos !=2 || str[1] != colon<path_type>::value)
926:     String basic_path<String, Traits>::filename() const
929:         detail::filename_pos<String, Traits>( m_path, m_path.size() ) );
930:       return (m_path.size()
932:                 && m_path[end_pos] == slash<path_type>::value
933:                 && detail::is_non_root_slash< String, Traits >(m_path, end_pos))
934:         ? String( 1, dot<path_type>::value )
935:         : m_path.substr( end_pos );
939:     String basic_path<String, Traits>::stem() const
942:       typename string_type::size_type n = name.rfind(dot<path_type>::value);
947:     String basic_path<String, Traits>::extension() const
950:       typename string_type::size_type n = name.rfind(dot<path_type>::value);
961:         detail::filename_pos<String, Traits>( m_path, m_path.size() ) );
963:       bool filename_was_separator( m_path.size()
964:         && m_path[end_pos] == slash<path_type>::value );
968:         <string_type, traits_type>( m_path, end_pos ) );
972:         && m_path[end_pos-1] == slash<path_type>::value
977:        ? path_type()
978:        : path_type( m_path.substr( 0, end_pos ) );
985:       for ( ; itr.m_pos != m_path.size()
986:           && (itr.m_name[0] == slash<path_type>::value
987: #     ifdef BOOST_WINDOWS_PATH
989:             == colon<path_type>::value
993:       return basic_path<String, Traits>( m_path.substr( itr.m_pos ) );
997:     String basic_path<String, Traits>::root_name() const
1001:       return ( itr.m_pos != m_path.size()
1004:               && itr.m_name[0] == slash<path_type>::value
1005:               && itr.m_name[1] == slash<path_type>::value
1007: #     ifdef BOOST_WINDOWS_PATH
1009:             == colon<path_type>::value
1017:     String basic_path<String, Traits>::root_directory() const
1020:         detail::root_directory_start<String, Traits>( m_path, m_path.size() ) );
1024:         : m_path.substr( start, 1 );
1031:       return basic_path<String, Traits>( root_name() ) /= root_directory();
1034:     // path query functions  -------------------------------------------------//
1037:     inline bool basic_path<String, Traits>::is_complete() const
1039: #   ifdef BOOST_WINDOWS_PATH
1049:       return !root_path().empty();
1053:     inline bool basic_path<String, Traits>::has_root_name() const
1059:     inline bool basic_path<String, Traits>::has_root_directory() const
1067:     void basic_path<String, Traits>::m_append_separator_if_needed()
1071: #       ifdef BOOST_WINDOWS_PATH
1072:         *(m_path.end()-1) != colon<path_type>::value && 
1074:         *(m_path.end()-1) != slash<path_type>::value )
1076:         m_path += slash<path_type>::value;
1081:     void basic_path<String, Traits>::m_append( value_type value )
1083: #   ifdef BOOST_CYGWIN_PATH
1084:       if ( m_path.empty() ) m_cygwin_root = (value == slash<path_type>::value);
1087: #   ifdef BOOST_WINDOWS_PATH
1088:       // for BOOST_WINDOWS_PATH, convert alt_separator ('\') to separator ('/')
1089:       m_path += ( value == path_alt_separator<path_type>::value
1090:         ? slash<path_type>::value
1093:       m_path += value;
1100:     basic_path<String, Traits> & basic_path<String, Traits>::operator /=
1104:       if ( *next_p == slash<path_type>::value
1105:         && *(next_p+1) == slash<path_type>::value
1106:         && *(next_p+2) == colon<path_type>::value ) next_p += 3;
1108:       // append slash<path_type>::value if needed
1110:         && !detail::is_separator<path_type>( *next_p ) )
1119:       basic_path<String, Traits> & basic_path<String, Traits>::append(
1122:       // append slash<path_type>::value if needed
1124:         && !detail::is_separator<path_type>( *first ) )
1132:       typename String::size_type initial_pos( m_path.size() );
1136:         if ( append_count == 0 && *first != slash<path_type>::value )
1138:         if ( append_count == 1 && *first != slash<path_type>::value )
1140:         if ( append_count == 2 && *first != colon<path_type>::value )
1148:         m_path.erase( initial_pos, 3 );
1159:     basic_path<String, Traits> & basic_path<String, Traits>::canonize()
1162:         = { dot<path_type>::value, 0 };
1164:       if ( m_path.empty() ) return *this;
1166:       path_type temp;
1174:       m_path = temp.m_path;
1181:     basic_path<String, Traits> & basic_path<String, Traits>::normalize()
1184:         = { dot<path_type>::value, 0 };
1186:       if ( m_path.empty() ) return *this;
1188:       path_type temp;
1196:           && (*itr)[0] == dot<path_type>::value
1203:           && (*itr)[0] == dot<path_type>::value
1204:           && (*itr)[1] == dot<path_type>::value ) // dot dot
1209:               || (lf[0] != dot<path_type>::value
1210:                 && lf[0] != slash<path_type>::value))
1212:               || (lf[0] != dot<path_type>::value
1213:                 && lf[1] != dot<path_type>::value
1214: #             ifdef BOOST_WINDOWS_PATH
1215:                 && lf[1] != colon<path_type>::value
1223:             if ( temp.m_path.size() > 0
1224:               && temp.m_path[temp.m_path.size()-1]
1225:                 == slash<path_type>::value )
1228:                 detail::root_directory_start<String,Traits>( temp.m_path,
1229:                   temp.m_path.size() ) );
1231:                 || rds != temp.m_path.size()-1 ) 
1232:                 { temp.m_path.erase( temp.m_path.size()-1 ); }
1246:       m_path = temp.m_path;
1255:     basic_path<String, Traits> & basic_path<String, Traits>::remove_filename()
1257:       m_path.erase(
1258:         detail::filename_pos<String, Traits>( m_path, m_path.size() ) );
1263:     basic_path<String, Traits> &
1264:     basic_path<String, Traits>::replace_extension( const string_type & new_ext )
1269:         m_path.erase( m_path.size() - old_ext.size() );
1271:       if ( !new_ext.empty() && new_ext[0] != dot<path_type>::value )
1272:         m_path += dot<path_type>::value;
1274:       m_path += new_ext;
1280:     // path conversion functions  --------------------------------------------//
1284:     basic_path<String, Traits>::file_string() const
1286: #   ifdef BOOST_WINDOWS_PATH
1291:         detail::root_directory_start<String, Traits>( m_path, m_path.size() ) );
1295:         pos != m_path.size(); ++pos )
1298:         if ( pos == 0 && m_path.size() > 1
1299:           && m_path[0] == slash<path_type>::value
1300:           && m_path[1] == slash<path_type>::value
1301:           && ( m_path.size() == 2 
1302:             || !detail::is_separator<path_type>( m_path[2] )
1306:           s += path_alt_separator<path_type>::value;
1307:           s += path_alt_separator<path_type>::value;
1315:             && s[s.size()-1] == path_alt_separator<path_type>::value
1316:             && m_path[pos] == slash<path_type>::value
1320:         if ( m_path[pos] == slash<path_type>::value )
1321:           s += path_alt_separator<path_type>::value;
1323:           s += m_path[pos];
1326:           && m_path[pos] == slash<path_type>::value )
1329: #   ifdef BOOST_CYGWIN_PATH
1330:       if ( m_cygwin_root ) s[0] = slash<path_type>::value;
1334:       return m_path;
1341:     typename basic_path<String, Traits>::iterator basic_path<String, Traits>::begin() const
1344:       itr.m_path_ptr = this;
1346:       detail::first_element<String, Traits>( m_path, itr.m_pos, element_size );
1347:       itr.m_name = m_path.substr( itr.m_pos, element_size );
1352:     typename basic_path<String, Traits>::iterator basic_path<String, Traits>::end() const
1355:         itr.m_path_ptr = this;
1356:         itr.m_pos = m_path.size();
1364:       template<class Path>
1365:       void iterator_helper<Path>::do_increment( iterator & itr )
1367:         typedef typename Path::string_type string_type;
1368:         typedef typename Path::traits_type traits_type;
1370:         assert( itr.m_pos < itr.m_path_ptr->m_path.size() && "basic_path::iterator increment past end()" );
1373:           && itr.m_name[0] == slash<Path>::value
1374:           && itr.m_name[1] == slash<Path>::value
1375:           && itr.m_name[2] != slash<Path>::value );
1381:         if ( itr.m_pos == itr.m_path_ptr->m_path.size() )
1388:         if ( itr.m_path_ptr->m_path[itr.m_pos] == slash<Path>::value )
1392:   #       ifdef BOOST_WINDOWS_PATH
1394:             || itr.m_name[itr.m_name.size()-1] == colon<Path>::value
1398:             itr.m_name = slash<Path>::value;
1403:           while ( itr.m_pos != itr.m_path_ptr->m_path.size()
1404:             && itr.m_path_ptr->m_path[itr.m_pos] == slash<Path>::value )
1408:           if ( itr.m_pos == itr.m_path_ptr->m_path.size()
1410:                 itr.m_path_ptr->m_path, itr.m_pos-1 ) ) 
1413:             itr.m_name = dot<Path>::value;
1420:           itr.m_path_ptr->m_path.find( slash<Path>::value, itr.m_pos ) );
1421:         itr.m_name = itr.m_path_ptr->m_path.substr( itr.m_pos, end_pos - itr.m_pos );
1426:       template<class Path>
1427:       void iterator_helper<Path>::do_decrement( iterator & itr )
1429:         assert( itr.m_pos && "basic_path::iterator decrement past begin()"  );
1431:         typedef typename Path::string_type string_type;
1432:         typedef typename Path::traits_type traits_type;
1438:             itr.m_path_ptr->m_path, end_pos ) );
1441:         if ( itr.m_pos == itr.m_path_ptr->m_path.size()
1442:           && itr.m_path_ptr->m_path.size() > 1
1443:           && itr.m_path_ptr->m_path[itr.m_pos-1] == slash<Path>::value
1445:                itr.m_path_ptr->m_path, itr.m_pos-1 ) 
1449:             itr.m_name = dot<Path>::value;
1458:           && itr.m_path_ptr->m_path[end_pos-1] == slash<Path>::value
1463:             ( itr.m_path_ptr->m_path, end_pos );
1464:         itr.m_name = itr.m_path_ptr->m_path.substr( itr.m_pos, end_pos - itr.m_pos );
1470:     template<class Path>
1471:     basic_filesystem_error<Path>::basic_filesystem_error(
1482:     template<class Path>
1483:     basic_filesystem_error<Path>::basic_filesystem_error(
1484:       const std::string & what_arg, const path_type & path1_arg,
1491:         m_imp_ptr->m_path1 = path1_arg;
1496:     template<class Path>
1497:     basic_filesystem_error<Path>::basic_filesystem_error(
1498:       const std::string & what_arg, const path_type & path1_arg,
1499:       const path_type & path2_arg, system::error_code ec )
1505:         m_imp_ptr->m_path1 = path1_arg;
1506:         m_imp_ptr->m_path2 = path2_arg;
1516: #endif // BOOST_FILESYSTEM_PATH_HPP
72:       static external_string_type to_external( const wpath &,
78:       static external_string_type to_external( const wpath & ph,
113:     template<> struct slash<wpath>
115:     template<> struct dot<wpath>
117:     template<> struct colon<wpath>
717:     typedef basic_filesystem_error<wpath> wfilesystem_error;
1030:       // even on POSIX, root_name() is non-empty() on network paths
chromium.googlesource.com/arc/arc:third_party/chromium-ppapi/third_party/blink/web_tests/paint/invalidation/clip/clip-path-in-mask-layer.html: [ master, ]
5:     <path id="path" d="M0 0 L1 1 L0 1 Z"/>
8: <div style="width: 200px; height: 200px; background: blue; clip-path: url(#clip); will-change: transform"></div>
11:   path.setAttribute('d', 'M0 0 L1 0 L1 1 L0 1 Z');
4: 	<clipPath id="clip" clipPathUnits='objectBoundingBox'>
6: 	</clipPath>
github.com/yeoman/doctor:lib/rules/node-path.js: [ master, ]
3: const path = require('path');
14:   pathMismatch(npmRoot) {
29: function fixPath(filepath) {
48:   const nodePaths = (process.env.NODE_PATH || '').split(path.delimiter).map(fixPath);
7: exports.description = 'NODE_PATH matches the npm root';
11:     return message.get('node-path-npm-failure', {});
15:     let msgPath = 'node-path-path-mismatch';
22:       path: process.env.NODE_PATH,
30:   let fixedPath = path.resolve(path.normalize(filepath.trim()));
44:   if (process.env.NODE_PATH === undefined) {
18:       msgPath += '-windows';
21:     return message.get(msgPath, {
33:     fixedPath = fs.realpathSync(fixedPath);
40:   return fixedPath;
52:     const npmRoot = fixPath(stdout);
55:       return errors.pathMismatch(npmRoot);
54:     if (nodePaths.indexOf(npmRoot) < 0) {
github.com/apache/brooklyn:brooklyn-client/cli/vendor/github.com/NodePrime/jsonpath/eval.go: [ master, ]
11: 	Path
1: package jsonpath
190: func pathMatchOp(q *query, e *Eval, i *Item) queryStateFn {
242: func pathEndValue(q *query, e *Eval, i *Item) queryStateFn {
46: func newEvaluation(tr tokenReader, paths ...*Path) *Eval {
73: func newQuery(p *Path) *query {
75: 		Path:        *p,
99: 	// run path function for each path
300: 			values[q.Path.stringValue] = i
59: 	for _, p := range paths {
76: 		state:       pathMatchOp,
232: 		return pathEndValue
238: 		return pathMatchOp
282: 		return pathMatchOp
284: 	return pathEndValue
208: 							queries:     make([]*query, len(nextOp.dependentPaths)),
212: 						for i, p := range nextOp.dependentPaths {
github.com/apache/uima-uimaj:src/main/scripts/setUimaClassPath.bat: [ trunk, ]
60: @set PATH=%UIMACPP_HOME%\bin;%UIMACPP_HOME%\examples\tutorial\src;%PATH%
27: @set LOCAL_SAVED_UIMA_CLASSPATH=%UIMA_CLASSPATH%
28: @set UIMA_CLASSPATH=%UIMA_HOME%\examples\resources
29: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%UIMA_HOME%\lib\uima-core.jar
30: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%UIMA_HOME%\lib\uima-document-annotation.jar
31: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%UIMA_HOME%\lib\uima-cpe.jar
32: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%UIMA_HOME%\lib\uima-tools.jar
33: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%UIMA_HOME%\lib\uima-examples.jar
34: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%UIMA_HOME%\lib\uima-adapter-soap.jar
35: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%UIMA_HOME%\lib\uima-adapter-vinci.jar
36: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%CATALINA_HOME%\webapps\axis\WEB-INF\lib\activation.jar
37: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%CATALINA_HOME%\webapps\axis\WEB-INF\lib\axis.jar
38: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%CATALINA_HOME%\webapps\axis\WEB-INF\lib\commons-discovery.jar
39: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%CATALINA_HOME%\webapps\axis\WEB-INF\lib\commons-discovery-0.2.jar
40: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%CATALINA_HOME%\webapps\axis\WEB-INF\lib\commons-logging.jar
41: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%CATALINA_HOME%\webapps\axis\WEB-INF\lib\commons-logging-1.0.4.jar
42: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%CATALINA_HOME%\webapps\axis\WEB-INF\lib\jaxrpc.jar
43: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%CATALINA_HOME%\webapps\axis\WEB-INF\lib\mail.jar
44: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%CATALINA_HOME%\webapps\axis\WEB-INF\lib\saaj.jar
45: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%UIMA_HOME%\lib\procyon-compilertools-0.5.28.jar
46: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%UIMA_HOME%\lib\procyon-core-0.5.28.jar
47: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%UIMA_HOME%\lib\jVinci.jar
49: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%UIMA_HOME%\lib\uimaj-as-core.jar
50: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%UIMA_HOME%\lib\uimaj-as-activemq.jar
51: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%UIMA_HOME%\lib\uimaj-as-jms.jar
52: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%LOCAL_SAVED_UIMA_CLASSPATH%
57: @set UIMA_CLASSPATH=%UIMA_CLASSPATH%;%_REALLYNOQUOTES%
58: @rem set path to support running C++ annotators
53: @rem All this nonsense is necessary to remove quotes from the CLASSPATH and also handle the case where there is no CLASSPATH
54: @set _NOQUOTES=%CLASSPATH:"=%
github.com/google/xrtl:third_party/swiftshader/third_party/llvm-subzero/lib/Support/Path.cpp: [ master, ]
231: namespace path {
1172: namespace path {
360: StringRef root_path(StringRef path) {
443: StringRef relative_path(StringRef path) {
493: StringRef parent_path(StringRef path) {
634: bool has_root_path(const Twine &path) {
641: bool has_relative_path(const Twine &path) {
655: bool has_parent_path(const Twine &path) {
135:   size_t parent_path_end(StringRef path) {
525: void replace_path_prefix(SmallVectorImpl<char> &Path,
1: //===-- Path.cpp - Implement OS Path Concept ------------------------------===//
10: //  This file implements the operating system Path API.
20: #include "llvm/Support/Path.h"
36:   using llvm::sys::path::is_separator;
46:   StringRef find_first_component(StringRef path) {
53:     if (path.empty())
54:       return path;
58:     if (path.size() >= 2 && std::isalpha(static_cast<unsigned char>(path[0])) &&
59:         path[1] == ':')
60:       return path.substr(0, 2);
64:     if ((path.size() > 2) &&
65:         is_separator(path[0]) &&
66:         path[0] == path[1] &&
67:         !is_separator(path[2])) {
69:       size_t end = path.find_first_of(separators, 2);
70:       return path.substr(0, end);
74:     if (is_separator(path[0]))
75:       return path.substr(0, 1);
78:     size_t end = path.find_first_of(separators);
79:     return path.substr(0, end);
136:     size_t end_pos = filename_pos(path);
138:     bool filename_was_sep = path.size() > 0 && is_separator(path[end_pos]);
141:     size_t root_dir_pos = root_dir_start(path.substr(0, end_pos));
145:           is_separator(path[end_pos - 1]))
170:     if (!sys::path::is_absolute(Twine(ModelStorage))) {
172:       sys::path::system_temp_directory(true, TDir);
173:       sys::path::append(TDir, Twine(ModelStorage));
179:   // path already exists.
185: retry_random_path:
199:         goto retry_random_path;
213:     goto retry_random_path;
220:         goto retry_random_path;
233: const_iterator begin(StringRef path) {
235:   i.Path      = path;
236:   i.Component = find_first_component(path);
241: const_iterator end(StringRef path) {
243:   i.Path      = path;
244:   i.Position  = path.size();
249:   assert(Position < Path.size() && "Tried to increment past end!");
255:   if (Position == Path.size()) {
268:   if (is_separator(Path[Position])) {
276:       Component = Path.substr(Position, 1);
281:     while (Position != Path.size() &&
282:            is_separator(Path[Position])) {
287:     if (Position == Path.size()) {
295:   size_t end_pos = Path.find_first_of(separators, Position);
296:   Component = Path.slice(Position, end_pos);
302:   return Path.begin() == RHS.Path.begin() && Position == RHS.Position;
309: reverse_iterator rbegin(StringRef Path) {
311:   I.Path = Path;
312:   I.Position = Path.size();
316: reverse_iterator rend(StringRef Path) {
318:   I.Path = Path;
319:   I.Component = Path.substr(0, 0);
326:   // we are the root path.
327:   size_t root_dir_pos = root_dir_start(Path);
328:   if (Position == Path.size() &&
329:       Path.size() > root_dir_pos + 1 &&
330:       is_separator(Path[Position - 1])) {
341:         is_separator(Path[end_pos - 1]))
345:   size_t start_pos = filename_pos(Path.substr(0, end_pos));
346:   Component = Path.slice(start_pos, end_pos);
352:   return Path.begin() == RHS.Path.begin() && Component == RHS.Component &&
361:   const_iterator b = begin(path),
363:                  e = end(path);
376:         return path.substr(0, b->size() + pos->size());
392: StringRef root_name(StringRef path) {
393:   const_iterator b = begin(path),
394:                  e = end(path);
410:   // No path or no name.
414: StringRef root_directory(StringRef path) {
415:   const_iterator b = begin(path),
417:                  e = end(path);
439:   // No path or no root.
444:   StringRef root = root_path(path);
445:   return path.substr(root.size());
448: void append(SmallVectorImpl<char> &path, const Twine &a,
464:     bool path_has_sep = !path.empty() && is_separator(path[path.size() - 1]);
468:     if (path_has_sep) {
474:       path.append(c.begin(), c.end());
478:     if (!component_has_sep && !(path.empty() || is_root_name)) {
480:       path.push_back(preferred_separator);
483:     path.append(component.begin(), component.end());
487: void append(SmallVectorImpl<char> &path,
490:     path::append(path, *begin);
494:   size_t end_pos = parent_path_end(path);
498:     return path.substr(0, end_pos);
501: void remove_filename(SmallVectorImpl<char> &path) {
502:   size_t end_pos = parent_path_end(StringRef(path.begin(), path.size()));
504:     path.set_size(end_pos);
507: void replace_extension(SmallVectorImpl<char> &path, const Twine &extension) {
508:   StringRef p(path.begin(), path.size());
515:     path.set_size(pos);
519:     path.push_back('.');
522:   path.append(ext.begin(), ext.end());
531:   StringRef OrigPath(Path.begin(), Path.size());
537:     std::copy(NewPrefix.begin(), NewPrefix.end(), Path.begin());
543:   path::append(NewPath, NewPrefix);
544:   path::append(NewPath, RelPath);
545:   Path.swap(NewPath);
548: void native(const Twine &path, SmallVectorImpl<char> &result) {
549:   assert((!path.isSingleStringRef() ||
550:           path.getSingleStringRef().data() != result.data()) &&
551:          "path and result are not allowed to overlap!");
554:   path.toVector(result);
558: void native(SmallVectorImpl<char> &Path) {
560:   std::replace(Path.begin(), Path.end(), '/', '\\');
562:   for (auto PI = Path.begin(), PE = Path.end(); PI < PE; ++PI) {
574: StringRef filename(StringRef path) {
575:   return *rbegin(path);
578: StringRef stem(StringRef path) {
579:   StringRef fname = filename(path);
591: StringRef extension(StringRef path) {
592:   StringRef fname = filename(path);
620: bool has_root_name(const Twine &path) {
621:   SmallString<128> path_storage;
622:   StringRef p = path.toStringRef(path_storage);
627: bool has_root_directory(const Twine &path) {
628:   SmallString<128> path_storage;
629:   StringRef p = path.toStringRef(path_storage);
635:   SmallString<128> path_storage;
636:   StringRef p = path.toStringRef(path_storage);
638:   return !root_path(p).empty();
642:   SmallString<128> path_storage;
643:   StringRef p = path.toStringRef(path_storage);
645:   return !relative_path(p).empty();
648: bool has_filename(const Twine &path) {
649:   SmallString<128> path_storage;
650:   StringRef p = path.toStringRef(path_storage);
656:   SmallString<128> path_storage;
657:   StringRef p = path.toStringRef(path_storage);
659:   return !parent_path(p).empty();
662: bool has_stem(const Twine &path) {
663:   SmallString<128> path_storage;
664:   StringRef p = path.toStringRef(path_storage);
669: bool has_extension(const Twine &path) {
670:   SmallString<128> path_storage;
671:   StringRef p = path.toStringRef(path_storage);
676: bool is_absolute(const Twine &path) {
677:   SmallString<128> path_storage;
678:   StringRef p = path.toStringRef(path_storage);
690: bool is_relative(const Twine &path) { return !is_absolute(path); }
692: StringRef remove_leading_dotslash(StringRef Path) {
694:   while (Path.size() > 2 && Path[0] == '.' && is_separator(Path[1])) {
695:     Path = Path.substr(2);
696:     while (Path.size() > 0 && is_separator(Path[0]))
697:       Path = Path.substr(1);
699:   return Path;
702: static SmallString<256> remove_dots(StringRef path, bool remove_dot_dot) {
705:   // Skip the root path, then look for traversal in the components.
706:   StringRef rel = path::relative_path(path);
707:   for (StringRef C : llvm::make_range(path::begin(rel), path::end(rel))) {
710:     // Leading ".." will remain in the path unless it's at the root.
716:       if (path::is_absolute(path))
722:   SmallString<256> buffer = path::root_path(path);
724:     path::append(buffer, C);
728: bool remove_dots(SmallVectorImpl<char> &path, bool remove_dot_dot) {
729:   StringRef p(path.data(), path.size());
732:   if (result == path)
735:   path.swap(result);
739: } // end namespace path
743: std::error_code getUniqueID(const Twine Path, UniqueID &Result) {
745:   std::error_code EC = status(Path, Status);
807:                                      SmallVectorImpl<char> &path,
809:   StringRef p(path.data(), path.size());
811:   bool rootDirectory = path::has_root_directory(p),
813:        rootName = path::has_root_name(p);
826:   else if (std::error_code ec = current_path(current_dir))
829:   // Relative path. Prepend the current directory.
831:     // Append path to the current directory.
832:     path::append(current_dir, p);
833:     // Set path to the result.
834:     path.swap(current_dir);
839:     StringRef cdrn = path::root_name(current_dir);
841:     path::append(curDirRootName, p);
842:     // Set path to the result.
843:     path.swap(curDirRootName);
848:     StringRef pRootName      = path::root_name(p);
849:     StringRef bRootDirectory = path::root_directory(current_dir);
850:     StringRef bRelativePath  = path::relative_path(current_dir);
851:     StringRef pRelativePath  = path::relative_path(p);
854:     path::append(res, pRootName, bRootDirectory, bRelativePath, pRelativePath);
855:     path.swap(res);
864:                               SmallVectorImpl<char> &path) {
865:   return make_absolute(current_directory, path, true);
868: std::error_code make_absolute(SmallVectorImpl<char> &path) {
869:   return make_absolute(Twine(), path, false);
872: std::error_code create_directories(const Twine &Path, bool IgnoreExisting,
875:   StringRef P = Path.toStringRef(PathStorage);
886:   StringRef Parent = path::parent_path(P);
942: std::error_code is_directory(const Twine &path, bool &result) {
944:   if (std::error_code ec = status(path, st))
954: std::error_code is_regular_file(const Twine &path, bool &result) {
956:   if (std::error_code ec = status(path, st))
968: std::error_code is_other(const Twine &Path, bool &Result) {
970:   if (std::error_code EC = status(Path, FileStatus))
977:   SmallString<128> path = path::parent_path(Path);
978:   path::append(path, filename);
979:   Path = path.str();
1140: std::error_code identify_magic(const Twine &Path, file_magic &Result) {
1142:   if (std::error_code EC = openFileForRead(Path, FD))
1155:   return fs::status(Path, result);
1164: #include "Unix/Path.inc"
1167: #include "Windows/Path.inc"
1174: bool user_cache_directory(SmallVectorImpl<char> &Result, const Twine &Path1,
1175:                           const Twine &Path2, const Twine &Path3) {
1177:     append(Result, Path1, Path2, Path3);
1183: } // end namespace path
162:                                           SmallVectorImpl<char> &ResultPath,