Skip to content

Commit 789e781

Browse files
committed
C++: Add prototypes for std::string methods to test.
1 parent 768e519 commit 789e781

File tree

1 file changed

+13
-0
lines changed
  • cpp/ql/test/library-tests/dataflow/taint-tests

1 file changed

+13
-0
lines changed

cpp/ql/test/library-tests/dataflow/taint-tests/stl.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@ namespace std
3939
class basic_string {
4040
public:
4141
typedef typename Allocator::size_type size_type;
42+
static const size_type npos = -1;
4243

4344
explicit basic_string(const Allocator& a = Allocator());
4445
basic_string(const charT* s, const Allocator& a = Allocator());
4546

4647
const charT* c_str() const;
48+
charT* data() noexcept;
49+
size_t length() const;
4750

4851
typedef std::iterator<random_access_iterator_tag, charT> iterator;
4952
typedef std::iterator<random_access_iterator_tag, const charT> const_iterator;
@@ -60,6 +63,16 @@ namespace std
6063
basic_string& append(const basic_string& str);
6164
basic_string& append(const charT* s);
6265
basic_string& append(size_type n, charT c);
66+
basic_string& assign(const basic_string& str);
67+
basic_string& assign(size_type n, charT c);
68+
basic_string& insert(size_type pos, const basic_string& str);
69+
basic_string& insert(size_type pos, size_type n, charT c);
70+
basic_string& replace(size_type pos1, size_type n1, const basic_string& str);
71+
basic_string& replace(size_type pos1, size_type n1, size_type n2, charT c);
72+
size_type copy(charT* s, size_type n, size_type pos = 0) const;
73+
void clear() noexcept;
74+
basic_string substr(size_type pos = 0, size_type n = npos) const;
75+
void swap(basic_string& s) noexcept/*(allocator_traits<Allocator>::propagate_on_container_swap::value || allocator_traits<Allocator>::is_always_equal::value)*/;
6376
};
6477

6578
template<class charT, class traits, class Allocator> basic_string<charT, traits, Allocator> operator+(const basic_string<charT, traits, Allocator>& lhs, const basic_string<charT, traits, Allocator>& rhs);

0 commit comments

Comments
 (0)