AcUtils
A high performance abstraction layer for AccuRev
Public Member Functions | Properties | List of all members
AcUtils.Element Class Reference

Defines the attributes of an element from the stat command. More...

Collaboration diagram for AcUtils.Element:
Collaboration graph
[legend]

Public Member Functions

string ToString (string format, IFormatProvider provider)
 The ToString implementation. More...
 
Equality comparison
bool Equals (Element other)
 IEquatable implementation to determine the equality of instances of type Element. More...
 
override bool Equals (object other)
 Overridden to determine equality. More...
 
override int GetHashCode ()
 Override appropriate for type Element. More...
 

Properties

string Location [get, set]
 Depot-relative path of the element. More...
 
bool Folder [get, set]
 true if the element is a folder, false otherwise. More...
 
bool Executable [get, set]
 UNIX/Linux systems only: true if the executable bit is set, false if cleared. More...
 
int EID [get, set]
 The element ID. More...
 
ElementType ElementType [get, set]
 The element's type: dir, text, binary, ptext, elink, or slink. More...
 
long Size [get, set]
 File size in bytes. More...
 
DateTime ModTime [get, set]
 The element's modification time. More...
 
string HierType [get, set]
 "Hierarchy type" of the element: parallel or serial. More...
 
int VirStreamNumber [get, set]
 Virtual stream number. More...
 
int VirVersionNumber [get, set]
 Virtual version number. More...
 
string NamedVersion [get, set]
 Named stream\version number designation, e.g. MARS_MAINT3\17 or MARS_MAINT3_barnyrd\22 More...
 
int RealStreamNumber [get, set]
 Real stream number. More...
 
int RealVersionNumber [get, set]
 Real version number. More...
 
string LapStream [get, set]
 Stream where the element is located when it has (underlap)(member) or (overlap)(member) status. More...
 
string TimeBasedStream [get, set]
 Name of the first time-based stream found when stat -s <stream> -o -B -fox is used to retrieve elements with (overlap) and/or (underlap) status in the specified stream and higher. Returns the specified -s <stream> name if it is a time-based stream. More...
 
string Status [get, set]
 The version's status, e.g. (kept)(member) More...
 

Order comparison

int CompareTo (Element other)
 Generic IComparable implementation (default) for comparing Element objects to sort by element location. More...
 
int IComparable. CompareTo (object other)
 Pre-generic interface implementation for code using reflection. More...
 

Detailed Description

Defines the attributes of an element from the stat command.

Definition at line 67 of file Stat.cs.

Member Function Documentation

int AcUtils.Element.CompareTo ( Element  other)
inline

Generic IComparable implementation (default) for comparing Element objects to sort by element location.

Parameters
otherAn Element object to compare with this instance.
Returns
Value indicating the relative order of the Element objects based on location.

Definition at line 143 of file Stat.cs.

Referenced by AcUtils.Element.CompareTo().

int IComparable. AcUtils.Element.CompareTo ( object  other)
inlineprivate

Pre-generic interface implementation for code using reflection.

Parameters
otherAn Element object to compare with this instance.
Returns
Return value of generic CompareTo(Element) version.
Exceptions
ArgumentExceptionthrown if argument is not an Element object.

Definition at line 160 of file Stat.cs.

bool AcUtils.Element.Equals ( Element  other)
inline

IEquatable implementation to determine the equality of instances of type Element.

Uses the element's EID, virtual stream/version numbers, real stream/version numbers, and named version to compare instances.

Parameters
otherThe Element object being compared to this instance.
Returns
true if Element other is the same, false otherwise.

Definition at line 99 of file Stat.cs.

Referenced by AcUtils.Element.Equals().

override bool AcUtils.Element.Equals ( object  other)
inline

Overridden to determine equality.

Returns
Return value of generic Equals(Element) version.

Definition at line 113 of file Stat.cs.

override int AcUtils.Element.GetHashCode ( )
inline

Override appropriate for type Element.

Returns
Hash of element's EID, virtual stream/version numbers, real stream/version numbers, and named version.

Definition at line 126 of file Stat.cs.

string AcUtils.Element.ToString ( string  format,
IFormatProvider  provider 
)
inline

The ToString implementation.

Parameters
formatThe format specifier to use, e.g. Console.WriteLine(elem.ToString("fs"));
providerAllow clients to format output for their own types using ICustomFormatter.
Returns
The formatted string.
Exceptions
FormatExceptionthrown if an invalid format string is specified.
Format specifiers:
  • LV Long version (verbose).
  • G Location, the depot-relative path of the element (default when not using a format specifier).
  • F True if the element is a folder, False otherwise.
  • E True if the executable bit is set, False if cleared. UNIX/Linux systems only.
  • I Element ID.
  • T The element's type: dir, text, binary, ptext, elink, or slink.
  • FS File size in bytes.
  • MT Element's modification time.
  • H "Hierarchy type" of the element, one of two possible values: parallel or serial.
  • V Virtual stream\version number format, e.g. 5\12
  • R Real stream\version number format.
  • N The named stream-name\version-number designation, e.g. MARS_STAGE\7 or MARS_STAGE_barnyrd\24
  • L Stream where the element is located when it has (underlap)(member) or (overlap)(member) status.
  • TB Name of first time-based stream found when stat -s <stream> -o -B -fox is used to retrieve elements with (overlap) and/or (underlap) status.
  • S The version's status, e.g. (kept)(member)

Definition at line 352 of file Stat.cs.

Property Documentation

int AcUtils.Element.EID
getset

The element ID.

Definition at line 202 of file Stat.cs.

Referenced by AcUtils.Element.GetHashCode(), and AcUtils.Stat.init().

ElementType AcUtils.Element.ElementType
getset

The element's type: dir, text, binary, ptext, elink, or slink.

Definition at line 211 of file Stat.cs.

Referenced by AcUtils.Stat.init().

bool AcUtils.Element.Executable
getset

UNIX/Linux systems only: true if the executable bit is set, false if cleared.

See also
AccuRev chmode command

Definition at line 193 of file Stat.cs.

Referenced by AcUtils.Stat.init().

bool AcUtils.Element.Folder
getset

true if the element is a folder, false otherwise.

Definition at line 183 of file Stat.cs.

Referenced by AcUtils.Stat.init().

string AcUtils.Element.HierType
getset

"Hierarchy type" of the element: parallel or serial.

Definition at line 239 of file Stat.cs.

Referenced by AcUtils.Stat.init().

string AcUtils.Element.LapStream
getset

Stream where the element is located when it has (underlap)(member) or (overlap)(member) status.

Include the -B option in the stat command to initialize this field.

See also
Example XML from stat command

Definition at line 295 of file Stat.cs.

Referenced by AcUtils.Stat.init().

string AcUtils.Element.Location
getset

Depot-relative path of the element.

Definition at line 174 of file Stat.cs.

Referenced by AcUtils.Stat.init().

DateTime AcUtils.Element.ModTime
getset

The element's modification time.

Definition at line 230 of file Stat.cs.

Referenced by AcUtils.Stat.init().

string AcUtils.Element.NamedVersion
getset

Named stream\version number designation, e.g. MARS_MAINT3\17 or MARS_MAINT3_barnyrd\22

Definition at line 266 of file Stat.cs.

Referenced by AcUtils.Element.GetHashCode(), and AcUtils.Stat.init().

int AcUtils.Element.RealStreamNumber
getset

Real stream number.

Definition at line 275 of file Stat.cs.

Referenced by AcUtils.Element.GetHashCode(), and AcUtils.Stat.init().

int AcUtils.Element.RealVersionNumber
getset

Real version number.

Definition at line 284 of file Stat.cs.

Referenced by AcUtils.Element.GetHashCode(), and AcUtils.Stat.init().

long AcUtils.Element.Size
getset

File size in bytes.

See also
Convert file size bytes to megabyte/gigabyte string using C#

Definition at line 221 of file Stat.cs.

Referenced by AcUtils.Stat.init().

string AcUtils.Element.Status
getset

The version's status, e.g. (kept)(member)

Definition at line 322 of file Stat.cs.

Referenced by AcUtils.Stat.init().

string AcUtils.Element.TimeBasedStream
getset

Name of the first time-based stream found when stat -s <stream> -o -B -fox is used to retrieve elements with (overlap) and/or (underlap) status in the specified stream and higher. Returns the specified -s <stream> name if it is a time-based stream.

Without -B, the -fo option does nothing. It should be viewed as a modifier of the -B option, as it causes the search to include (overlap) and (underlap) elements above time-based streams. (-B without -fo stops when the first time-based stream is encountered and does not include these elements.) The -fox option is required to initialize this property. The -o option is required in all cases. The XML emitted via -fx includes the element-ID, so there's no need to include 'e' as in -foex to ensure Element.EID is initialized.

See also
Example XML from stat command

Definition at line 313 of file Stat.cs.

Referenced by AcUtils.Stat.init().

int AcUtils.Element.VirStreamNumber
getset

Virtual stream number.

Definition at line 248 of file Stat.cs.

Referenced by AcUtils.Element.GetHashCode(), and AcUtils.Stat.init().

int AcUtils.Element.VirVersionNumber
getset

Virtual version number.

Definition at line 257 of file Stat.cs.

Referenced by AcUtils.Element.GetHashCode(), and AcUtils.Stat.init().