Major update: refactored the API of all classes to make attributes start with a lower case letter and rename encode=>to_ccnb() and decode()=>from_ccnb.
(according to the API notes: http://sea.remap.ucla.edu:8080/attachments/download/23/lwndn_api-notes_21020830.txt )
diff --git a/js/Interest.js b/js/Interest.js
index 46303b1..15fb05a 100644
--- a/js/Interest.js
+++ b/js/Interest.js
@@ -37,7 +37,7 @@
decoder.readStartElement(CCNProtocolDTags.Interest);
this.name = new ContentName();
- this.name.decode(decoder);
+ this.name.from_ccnb(decoder);
if (decoder.peekStartElement(CCNProtocolDTags.MinSuffixComponents)) {
this.minSuffixComponents = decoder.readIntegerElement(CCNProtocolDTags.MinSuffixComponents);
@@ -48,13 +48,13 @@
}
if (decoder.peekStartElement(CCNProtocolDTags.PublisherPublicKeyDigest)) {
- this.publisherPublicKeyDigest = new PublisherPublicKeyDigest();
- this.publisherPublicKeyDigest.decode(decoder);
+ this.publisherPublicKeyDigest = new publisherPublicKeyDigest();
+ this.publisherPublicKeyDigest.from_ccnb(decoder);
}
if (decoder.peekStartElement(CCNProtocolDTags.Exclude)) {
this.exclude = new Exclude();
- this.exclude.decode(decoder);
+ this.exclude.from_ccnb(decoder);
}
if (decoder.peekStartElement(CCNProtocolDTags.ChildSelector)) {
@@ -86,7 +86,7 @@
encoder.writeStartElement(CCNProtocolDTags.Interest);
- this.name.encode(encoder);
+ this.name.to_ccnb(encoder);
if (null != this.minSuffixComponents)
encoder.writeElement(CCNProtocolDTags.MinSuffixComponents, this.minSuffixComponents);
@@ -95,10 +95,10 @@
encoder.writeElement(CCNProtocolDTags.MaxSuffixComponents, this.maxSuffixComponents);
if (null != this.publisherPublicKeyDigest)
- this.publisherPublicKeyDigest.encode(encoder);
+ this.publisherPublicKeyDigest.to_ccnb(encoder);
if (null != this.exclude)
- this.exclude.encode(encoder);
+ this.exclude.to_ccnb(encoder);
if (null != this.childSelector)
encoder.writeElement(CCNProtocolDTags.ChildSelector, this.childSelector);
@@ -118,8 +118,8 @@
};
Interest.prototype.matches_name = function(/*ContentName*/ name){
- var i_name = this.name.Components;
- var o_name = name.Components;
+ var i_name = this.name.components;
+ var o_name = name.components;
// The intrest name is longer than the name we are checking it against.
if (i_name.length > o_name.length)