mirror of https://github.com/adamdruppe/arsd.git
helper class for returning static files
This commit is contained in:
parent
3f092d36d3
commit
ab80b79c8f
17
web.d
17
web.d
|
@ -443,6 +443,23 @@ class ApiObject : WebDotDBaseType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class DataFile : FileResource {
|
||||||
|
this(string contentType, immutable(void)[] contents) {
|
||||||
|
_contentType = contentType;
|
||||||
|
_content = contents;
|
||||||
|
}
|
||||||
|
|
||||||
|
private string _contentType;
|
||||||
|
private immutable(void)[] _content;
|
||||||
|
|
||||||
|
string contentType() const {
|
||||||
|
return _contentType;
|
||||||
|
}
|
||||||
|
|
||||||
|
immutable(ubyte)[] getData() {
|
||||||
|
return cast(immutable(ubyte)[]) _content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Describes the info collected about your class
|
/// Describes the info collected about your class
|
||||||
struct ReflectionInfo {
|
struct ReflectionInfo {
|
||||||
|
|
Loading…
Reference in New Issue