github.com/Tri-stone/burrow@v0.25.0/tests/jobs_fixtures/app42-getting-setting-strings-dynamic-arrays/driver.sol (about)

     1  pragma solidity >=0.0.0;
     2  contract Driver {
     3      string _name;
     4      bytes32[] _ownedCars;
     5  
     6      function getName() public view returns (string memory) {
     7          return _name;
     8      }
     9      function getCars() public view returns (bytes32[] memory) {
    10          return _ownedCars;
    11      }
    12      function setName(string memory name) public {
    13          _name = name;
    14      }
    15      function addCar(bytes32 car) public {
    16          _ownedCars.push(car);
    17      }
    18  
    19      function addCars(bytes32[] memory cars) public {
    20          for (uint index = 0; index < cars.length; index++) {
    21              _ownedCars.push(cars[index]);
    22          }
    23      }
    24      
    25      function getCarAmount() public view returns (uint) {
    26          return _ownedCars.length;
    27      }
    28  }
    29