nsISimpleEnumeratorãã©ããã³ã°
使ãããã¯ãããªæãã«ã
function list(_enum,type){
this._enum=_enum;
this.type=type;
}
list.prototype={
cache:new Array(),
get:function(aNum){
if(aNum==-1)return;
if(this.cache[aNum])return this.cache[aNum];
while(this._enum.hasMoreElements()){
this.cache.push(this._enum.getNext().QueryInterface(this.type));
if(aNum==this.cache.length-1)return this.cache[aNum];
}
return void(0);
}
}
ãããªãé ·ããã¨ãã¦ã¾ããæ°ã«ããªãã
var entries = testDir.directoryEntries;
entries=new list(entries,Components.interfaces.nsILocalFile);
entries.get(Number.MAX_VALUE);
var test="";
for(i in entries.cache){
test+=entries.cache[i].leafName+"\n";
}
alert(test);
èªç±ã«å©ç¨ã©ããã
ãã¹ããã¦ã¿ã¦è²ã ãã¹ã£ã¦ãã®ãä¿®æ£ã
å¦ã§å ãã¼ã¿ãå¤æ´ã«ãªã£ãå ´åã£ã¦ã©ããªã£ã¦ããã ããâ¦
XULWikiã®æ¹ã«ãæ¸ãã¦ãã¾ããã