Ignore:
Timestamp:
07/03/20 00:37:13 (4 years ago)
Author:
Maciej Komosinski
Message:

Increased SString and std::string compatibility: introduced length(), size(), and capacity(), and removed legacy methods that have std::string equivalents

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/_demos/loader_test_geno.cpp

    r732 r973  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    2020                        "If a genotype is indicated (by providing the optional genotype identifier), the program will output the raw genotype, suitable for Framsticks Theater's genotype viewer mode. If a genotype and a field name is given, the field value (instead of the raw genotype) is printed. If the second argument is not given, the genotype names from the file will be listed.\n"
    2121                        "Example: loader_test walking.gen \"Basic Quadruped\" | theater -g -\n"
    22                         );
     22                );
    2323                return 1;
    2424        }
     
    2929        const char* selected = (argc < 3) ? NULL : argv[2];
    3030        const char* field_name = (argc < 4) ? NULL : argv[3];
    31         int selected_index = (selected&&isdigit(selected[0])) ? atol(selected) : 0;
     31        int selected_index = (selected && isdigit(selected[0])) ? atol(selected) : 0;
    3232        // using char* constructor (passing the file name to open)
    3333        GenotypeMini *loaded;
     
    3636                // loaded into MiniGenotype object
    3737                count++;
    38                 totalsize += loaded->genotype.len();
     38                totalsize += loaded->genotype.length();
    3939                if (selected)
    4040                {
     
    6565                        return 0;
    6666                }
    67                 fprintf(stderr, "%d. %s\t(%d characters)\n", count, loaded->name.c_str(), loaded->genotype.len());
     67                fprintf(stderr, "%d. %s\t(%d characters)\n", count, loaded->name.c_str(), loaded->genotype.length());
    6868        }
    6969        // the loop repeats until loaded==NULL, which could be beacause of error
Note: See TracChangeset for help on using the changeset viewer.