Skip to content

Instantly share code, notes, and snippets.

@lomereiter
Created May 27, 2012 22:01
Show Gist options
  • Save lomereiter/2816072 to your computer and use it in GitHub Desktop.
Save lomereiter/2816072 to your computer and use it in GitHub Desktop.
...
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