Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct HTMLDocument{
- function FromSourceString(source:string):HTMLDocument{
- var doc:HTMLDocument = HTMLDocument{};
- doc.path = "unknown";
- doc.contents = ParseSource(source);
- return doc;
- }
- function FromPath(path:string):HTMLDocument{
- var doc:HTMLDocument = HTMLDocument{};
- doc.path = path;
- doc.contents = ParseSource(ReadFile(path));
- return doc;
- }
- }
- function foo(obj:out HTMLDocument){
- *obj = HTMLDocument.FromSourceString("<html/>");
- var doc:HTMLDocument;
- doc = HTMLDocument.FromPath("http://google.com");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement