var Depot = require('./Depot'); var Dir = require('./Dir'); var File = require('./File'); require('../polyfill'); function toItem(obj) { if (obj['Dir']) { return new Dir(obj); } else if (obj['DepotFile']) { return new File(obj); } else if (obj['Depot']) { var d = new Depot(obj); return d; } throw "obj is not a Dir, DepotFile, or Depot: " + obj; } var PathItem = { fromArray: function(items) { return items.map(function(x) { return toItem(x); }); } }; module.exports = PathItem;
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15741 | ptomiak | Branch HWS for my use. | ||
//guest/perforce_software/helix-web-services/main/source/helix_web_services_client_js/models/PathItem.js | |||||
#1 | 15622 | tjuricek |
Move source code to 'source/' subdirectory of branch. build/ will remain where it is. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services_client_js/models/PathItem.js | |||||
#1 | 14108 | tjuricek |
Added models for handling Perforce server depot listing and traversal. This is not complete, however, the models are a start to making it easy to generate a tree control. (Most tree controls in the wild assume you know the tree structure from the start, which is not true in our case.) The tricky bit is making it easy to build the tree out given that you're visiting only one directory at a time. |