Gary Morrison | ced8c6f | 2020-02-27 19:35:59 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2019-2020, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #ifndef STRING_OPS_HPP |
| 9 | #define STRING_OPS_HPP |
| 10 | |
| 11 | #include <cstddef> |
| 12 | #include <string> |
| 13 | |
| 14 | using namespace std; |
| 15 | |
| 16 | // Replace first occurrence of find_str within orig of replace_str: |
| 17 | size_t find_replace_1st (const string &find_str, const string &replace_str, |
| 18 | string &orig); |
| 19 | |
| 20 | // Replace all occurrences of find_str in "this" string, with replace_str: |
| 21 | size_t find_replace_all (const string &find_str, const string &replace_str, |
| 22 | string &orig); |
| 23 | |
| 24 | /* In both of the above string-replacement functions, the return value is start |
| 25 | offset to the (last) occurrence of "find_str" within "orig." */ |
| 26 | |
| 27 | #endif // #ifndef STRING_OPS_HPP |