Changeset 734 for cpp/frams


Ignore:
Timestamp:
02/15/18 00:44:00 (7 years ago)
Author:
Maciej Komosinski
Message:

SString -> std::string

Location:
cpp/frams/param
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/param/paramtree.cpp

    r723 r734  
     1// This file is a part of Framsticks SDK.  http://www.framsticks.com/
     2// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
     3// See LICENSE.txt for details.
     4
    15#include "paramtree.h"
    26
    3 ParamTree::Node *ParamTree::addNode(ParamTree::Node* parent, const SString& name, int group)
     7ParamTree::Node *ParamTree::addNode(ParamTree::Node* parent, const string& name, int group)
    48{
    59        std::shared_ptr<Node> new_it(new Node(this, parent, name, group));
     
    2125}
    2226
    23 ParamTree::Node *ParamTree::findNode(ParamTree::Node *parent, const SString& name)
     27ParamTree::Node *ParamTree::findNode(ParamTree::Node *parent, const string& name)
    2428{
    2529        for (ParamTree::Node *it = parent->first_child.get(); it != NULL; it = it->next_sibling.get())
     
    5357                        if (colons != level) continue;
    5458
    55                         SString name = grname; // "abc:def:ghi"
     59                        string name = grname; // "abc:def:ghi"
    5660                        Node *parentnode = &root;
    5761                        int i = 0;
     
    5963                        for (int haslevel = 0; haslevel < level; haslevel++)
    6064                        {
    61                                 i = name.indexOf(':', 0); // can't fail!
     65                                i = name.find(':'); // always succeeds because we counted the colons before
    6266                                // "na:me" -> prefix="na",name="me"
    63                                 SString prefix = name.substr(0, i);
     67                                string prefix = name.substr(0, i);
    6468                                // search for parent node in listview ('prefix')
    6569                                Node *it = findNode(parentnode, prefix);
  • cpp/frams/param/paramtree.h

    r728 r734  
     1// This file is a part of Framsticks SDK.  http://www.framsticks.com/
     2// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
     3// See LICENSE.txt for details.
     4
    15#ifndef _PARAMTREE_H_
    26#define _PARAMTREE_H_
     
    3842                ParamTree *tree;
    3943                Node *parent;
    40                 SString name; //path component name
     44                string name; //path component name
    4145                int group_index; //original group index or -1 for dummy nodes
    4246                NodePtr first_child;
    4347                NodePtr next_sibling;
    4448
    45                 Node(ParamTree *_tree = NULL, Node *_parent = NULL, const SString &_name = "", int _group_index = -1)
     49                Node(ParamTree *_tree = NULL, Node *_parent = NULL, const string &_name = "", int _group_index = -1)
    4650                        :tree(_tree), parent(_parent), name(_name), group_index(_group_index) {}
    4751        };
     
    4953        ParamInterface &pi;
    5054
    51         Node *addNode(Node* parent, const SString &name, int group);
    52         Node *findNode(Node *parent, const SString& name);
     55        Node *addNode(Node* parent, const string &name, int group);
     56        Node *findNode(Node *parent, const string& name);
    5357
    5458        ParamTree(ParamInterface &_pi);
Note: See TracChangeset for help on using the changeset viewer.