This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module cmsed.test.routes.test; | |
import cmsed.base.routing; | |
import cmsed.base.restful; | |
import cmsed.test.models.book; | |
class Test : OORoute { | |
@RouteGroup(null, "/test.svc") { | |
mixin RestfulRoute!(RestfulProtection.All, Book3, Page3); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module cmsed.test.routes; | |
import cmsed.test.models.book; | |
import cmsed.base.registration.routes; | |
import cmsed.base.registration.onload; | |
public import cmsed.test.routes.test; | |
shared static this() { | |
registerRoute!Test(); | |
void func(bool isInstall) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cmsed.base; | |
class ExampleRoute : OORoute { | |
@RouteFunction(RouteType.Get, "/mypath/:myarg") | |
void anyNameMyFunc() { | |
if (http_request.params.get("myarg", "") != "") { | |
http_reponse.writeBody(http_request.params["myarg"]); | |
} else { | |
http_response.writeBody("You failed haha!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cmsed.base; | |
class ExampleRoute : OORoute { | |
@RouteFunction(RouteType.Get, "/mypath", "mytemplate") | |
bool anyNameFunc() { | |
return true; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test : OORoute { | |
@RouteGroup(null, "/.svc") { | |
mixin RestfulRoute!(RestfulProtection.All, Book3, Page3); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Books3 = Class({ | |
constructor: function(_id, edition) { | |
this._id = _id === undefined ? "" : _id; | |
this.edition = Number(edition === undefined ? "0" : edition); | |
}, | |
save: function() { | |
var this_ = this; | |
new Ajax.Request("/.svc/Books3/" + this._id, { | |
method: "POST", | |
parameters: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module cmsed.test.models.book; | |
import cmsed.base.routing; | |
import dvorm; | |
@dbName("Books3") | |
class Book3 { | |
@dbId | |
@dbName("") | |
Book3Id key = new Book3Id; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mixin template MixinUDACheck(T) { | |
mixin("bool is" ~ T.stringof ~ " (C, string f)(C c = C.init)" ~ q{{ | |
foreach(UDA; __traits(getAttributes, mixin("c." ~ f))) { | |
static if (is(UDA == T)) { | |
return true; | |
} | |
} | |
return false; | |
}}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
T mul(T)(T x, T y) { | |
return x * y; | |
} | |
void test(size_t function(size_t x, size_t y) mul) { | |
assert(mul(2, 2) == 4); | |
} | |
void main() { | |
test(&mul!size_t); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
Include: test.h | |
Include: test2.h | |
Unknown: { | |
something | |
} | |
Condition: 1 + 1 == 2 { |