Changeset 20818 for lang/cplusplus
- Timestamp:
- 10/05/08 23:35:19 (2 months ago)
- Location:
- lang/cplusplus/llv8call/trunk
- Files:
-
- 3 modified
-
manual/ext/index.html (modified) (2 diffs)
-
t/020_ext/08_clearsilver.js (modified) (1 diff)
-
tools/makedoc/make-docs.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/cplusplus/llv8call/trunk/manual/ext/index.html
r20816 r20818 19 19 <ul> 20 20 <li><a href="clearsilver/clearsilver.html">clearsilver.clearsilver</a></li> 21 <li><a href="sqlite3/sqlite3.html">sqlite3.sqlite3</a></li>22 21 <li><a href="fs/dir.html">fs.dir</a></li> 23 22 <li><a href="fs/file.html">fs.file</a></li> … … 25 24 <li><a href="mysql/mysql.html">mysql.mysql</a></li> 26 25 <li><a href="shttpd/shttpd.html">shttpd.shttpd</a></li> 26 <li><a href="sqlite3/sqlite3.html">sqlite3.sqlite3</a></li> 27 27 </ul> 28 28 <a href="../index.html">up</a> -
lang/cplusplus/llv8call/trunk/t/020_ext/08_clearsilver.js
r20788 r20818 37 37 }()); 38 38 39 (function () { 40 clearsilver.HDF.prototype.SetAny = function (base, stuff) { 41 switch (typeof stuff) { 42 case 'boolean': 43 case 'string': 44 case 'null': 45 case 'number': 46 this.SetValue(base, stuff); 47 break; 48 case 'object': 49 case 'array': 50 for (key in stuff) { 51 this.SetAny(base + "." + key, stuff[key]); 52 } 53 break; 54 case 'function': 55 throw "cannot use function"; 56 default: 57 throw "unknown stuff: " + typeof(stuff); 58 } 59 }; 60 61 var test = function (stuff, expected) { 62 var hdf = new clearsilver.HDF(); 63 hdf.SetAny("data", stuff); 64 is(hdf.DumpStr(undefined, 0), expected); 65 hdf.Close(); 66 }; 67 68 test(1, "data = 1\n"); 69 test([1,2,3], 70 "data.0 = 1\n" + 71 "data.1 = 2\n" + 72 "data.2 = 3\n" 73 ); 74 test({"foo":"bar", "baz":"eee"}, 75 "data.foo = bar\n" + 76 "data.baz = eee\n" 77 ); 78 test({"foo":[1,2,3], "baz":"eee"}, 79 "data.foo.0 = 1\n" + 80 "data.foo.1 = 2\n" + 81 "data.foo.2 = 3\n" + 82 "data.baz = eee\n" 83 ); 84 }()); 85 -
lang/cplusplus/llv8call/trunk/tools/makedoc/make-docs.js
r20815 r20818 4 4 var TMPLDIR = 'tools/makedoc/tmpl'; 5 5 6 clearsilver.HDF.prototype.AddArray = function (basekey, ary) { 7 for (var i=0; i<ary.length; i++) { 8 this.SetValue(basekey + "." + i, ary[i]); 9 } 10 }; 11 clearsilver.HDF.prototype.AddHash = function (basekey, hash) { 12 for (i in hash) { 13 this.SetValue(basekey + "." + i, hash[i]); 6 clearsilver.HDF.prototype.SetAny = function (base, stuff) { 7 switch (typeof stuff) { 8 case 'boolean': 9 case 'string': 10 case 'null': 11 case 'number': 12 this.SetValue(base, stuff); 13 break; 14 case 'object': 15 case 'array': 16 for (key in stuff) { 17 this.SetAny(base + "." + key, stuff[key]); 18 } 19 break; 20 case 'function': 21 throw "cannot use function"; 22 default: 23 throw "unknown stuff: " + typeof(stuff); 14 24 } 15 25 }; … … 60 70 var hdf = new clearsilver.HDF(); 61 71 var res; 62 for (var i=0; i<data.modules.length; i++) { 63 var entry = data.modules[i]; 64 var basekey = "data.modules." + i 65 hdf.SetValue(basekey + ".CLASSNAME", entry['CLASSNAME']); 66 hdf.AddArray(basekey + ".CCV", entry["CCV"]); 67 hdf.AddArray(basekey + ".CM", entry["CM"]); 68 hdf.AddArray(basekey + ".IM", entry["IM"]); 69 } 70 if(data.sections.SYNOPSIS) { 71 hdf.SetValue("data.sections.SYNOPSIS", data.sections.SYNOPSIS); 72 } 73 if(data.sections.DESCRIPTION) { 74 hdf.SetValue("data.sections.DESCRIPTION", data.sections.DESCRIPTION); 75 } 76 // p(hdf.DumpStr(undefined, 0)); 72 hdf.SetAny("data", data); 73 //p(hdf.DumpStr(undefined, 0)); 77 74 var cs = new clearsilver.CS(hdf); 78 75 cs.ParseFile(TMPLDIR + "/doc.cs"); … … 144 141 var res; 145 142 for (i in pages) { 146 hdf. AddHash("pages." + i, {"url":pages[i], "title":pages[i].replace(".html", '').replace("/", ".")});143 hdf.SetAny("pages." + i, {"url":pages[i], "title":pages[i].replace(".html", '').replace("/", ".")}); 147 144 } 148 145 // p(hdf.DumpStr(undefined, 0));
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)