Last change
on this file since 359 was
359,
checked in by Maciej Komosinski, 9 years ago
|
Display error/warning messages by default
|
-
Property svn:eol-style set to
native
|
File size:
804 bytes
|
Rev | Line | |
---|
[286] | 1 | // This file is a part of Framsticks SDK. http://www.framsticks.com/ |
---|
| 2 | // Copyright (C) 1999-2015 Maciej Komosinski and Szymon Ulatowski. |
---|
| 3 | // See LICENSE.txt for details. |
---|
[109] | 4 | |
---|
| 5 | #include <frams/virtfile/stdiofile.h> |
---|
| 6 | #include <frams/util/sstringutils.h> |
---|
[145] | 7 | #include <frams/genetics/preconfigured.h> |
---|
[359] | 8 | #include <frams/errmgr/stdouterr.h> |
---|
[109] | 9 | |
---|
| 10 | /** |
---|
| 11 | @file |
---|
| 12 | Sample code: Testing genotype validity |
---|
| 13 | |
---|
| 14 | \include geno_test.cpp |
---|
| 15 | */ |
---|
| 16 | |
---|
| 17 | int main(int argc,char*argv[]) |
---|
| 18 | { |
---|
[145] | 19 | PreconfiguredGenetics genetics; |
---|
[359] | 20 | StdoutErrorHandler stdouterr; //comment this object out to mute error/warning messages |
---|
[145] | 21 | |
---|
[109] | 22 | if (argc<=1) |
---|
| 23 | { |
---|
| 24 | puts("no genotype"); |
---|
| 25 | return 10; |
---|
| 26 | } |
---|
| 27 | SString gen(argv[1]); |
---|
[348] | 28 | if (!strcmp(gen.c_str(),"-")) |
---|
[109] | 29 | { |
---|
| 30 | gen=0; |
---|
| 31 | StdioFILEDontClose in(stdin); |
---|
| 32 | loadSString(&in,gen); |
---|
| 33 | } |
---|
| 34 | Geno g(gen); |
---|
| 35 | puts(g.isValid()?"valid":"invalid"); |
---|
| 36 | return !g.isValid(); |
---|
| 37 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.