source: cpp/gdk/genotest.cpp @ 57

Last change on this file since 57 was 5, checked in by sz, 16 years ago

added the GDK (Genotype Development Kit)

File size: 740 bytes
Line 
1// This file is a part of Framsticks GDK library.
2// Copyright (C) 2002-2006  Szymon Ulatowski.  See LICENSE.txt for details.
3// Refer to http://www.frams.alife.pl/ for further information.
4
5#include "geno.h"
6#include "stdiofile.h"
7#include "sstringutils.h"
8#include "defgenoconv.h"
9
10/**
11 @file
12 Sample code: Testing genotype validity
13
14 \include genotest.cpp
15*/
16
17DefaultGenoConvManager gcm; //without this object the application would only handle "format 0" genotypes
18
19int main(int argc,char*argv[])
20{
21if (argc<=1)
22        {
23        puts("no genotype");
24        return 10;
25        }
26SString gen(argv[1]);
27if (!strcmp(gen,"-"))
28        {
29        gen=0;
30        StdioFILEDontClose in(stdin);
31        loadSString(&in,gen);
32        }
33Geno g(gen);
34puts(g.isValid()?"valid":"invalid");
35return !g.isValid();
36}
Note: See TracBrowser for help on using the repository browser.