Created
May 27, 2012 22:01
-
-
Save lomereiter/2816072 to your computer and use it in GitHub Desktop.
...
This file contains 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
struct Section { | |
this(QTabFile file, string tag) { | |
... | |
} | |
/// Allows to iterate over section lines with foreach. | |
int opApply(int delegate(string) call_line) { | |
... | |
} | |
string[string] dict() @property { | |
... /* lazily initialized */ | |
} | |
} | |
class QTabFile { | |
this(string filename) { ... } | |
/// just syntax sugar | |
Section opIndex(string tag) { | |
return Section(this, tag); | |
} | |
void close() { ... } | |
} | |
auto f = new QTabFile(...); | |
scope(exit) f.close(); | |
foreach(line; f["Genotype Symbol"]) { | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment