Change 14534

tony
tony committed this change into //guest/perforce_software/p4ruby/main
Request Review
Download .zip
Add support for the MapApi class in P4Ruby.
This change adds a new
class, P4::Map, to P4Ruby's canon. The methods on P4::Map are:

    P4::Map.new        - Constructor
    P4::Map.load        - Load a map from an array
    P4::Map.join        - Join two maps to create a third

    P4::Map#clear        - Empty a map
    P4::Map#count        - Return the number of entries
    P4::Map#empty?        - Tests whether a map object is empty
    P4::Map#translate    - Translate a string through a map
    P4::Map#includes?    - Tests whether a path is mapped
    P4::Map#lhs        - Returns the left side as an array
    P4::Map#rhs        - Returns the right side as an array
    P4::Map#to_a        - Returns the map as an array

(Note, the first three are class methods, the rest instance methods)

There is also P4::Map#reverse(), but I'm not documenting that yet as
I'm not sure I understand the semantics of reversing complex maps
well enough.

User-visible enhancement documented in p4rubynotes.txt and slated
for 2008.2 release.
  • Files 5
  • Comments 0
2 edited 3 added 0 deleted
MANIFEST#6
Loading...
p4.cpp#21
Loading...
p4mapmaker.cpp#1
Loading...
p4mapmaker.h#1
Loading...
test/11_maps.rb#1
Loading...
Tip: Use n and p to cycle through the changes.