Last change
on this file since 132 was
121,
checked in by sz, 11 years ago
|
updated file headers and makefiles
|
-
Property svn:eol-style set to
native
|
File size:
815 bytes
|
Rev | Line | |
---|
[121] | 1 | // This file is a part of the Framsticks GDK. |
---|
| 2 | // Copyright (C) 2002-2014 Maciej Komosinski and Szymon Ulatowski. See LICENSE.txt for details. |
---|
[109] | 3 | // Refer to http://www.framsticks.com/ for further information. |
---|
| 4 | |
---|
[121] | 5 | #include <frams/genetics/geno.h> |
---|
[109] | 6 | #include <frams/virtfile/stdiofile.h> |
---|
| 7 | #include <frams/util/sstringutils.h> |
---|
[121] | 8 | #include <frams/genetics/defgenoconv.h> |
---|
[109] | 9 | |
---|
| 10 | /** |
---|
| 11 | @file |
---|
| 12 | Sample code: Testing genotype validity |
---|
| 13 | |
---|
| 14 | \include geno_test.cpp |
---|
| 15 | */ |
---|
| 16 | |
---|
| 17 | DefaultGenoConvManager gcm; //without this object the application would only handle "format 0" genotypes |
---|
| 18 | |
---|
| 19 | int main(int argc,char*argv[]) |
---|
| 20 | { |
---|
| 21 | if (argc<=1) |
---|
| 22 | { |
---|
| 23 | puts("no genotype"); |
---|
| 24 | return 10; |
---|
| 25 | } |
---|
| 26 | SString gen(argv[1]); |
---|
| 27 | if (!strcmp(gen,"-")) |
---|
| 28 | { |
---|
| 29 | gen=0; |
---|
| 30 | StdioFILEDontClose in(stdin); |
---|
| 31 | loadSString(&in,gen); |
---|
| 32 | } |
---|
| 33 | Geno g(gen); |
---|
| 34 | puts(g.isValid()?"valid":"invalid"); |
---|
| 35 | return !g.isValid(); |
---|
| 36 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.