File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3635,6 +3635,26 @@ class PShader {
36353635
36363636
36373637
3638+ // Java StringBuilder
3639+ class StringBuilder {
3640+ ::std::string buf;
3641+ public:
3642+ StringBuilder () = default ;
3643+ StringBuilder (const ::std::string& s) : buf(s) {}
3644+ template <class T > StringBuilder& append (T v) { buf += ::std::to_string (v); return *this ; }
3645+ StringBuilder& append (const ::std::string& s) { buf += s; return *this ; }
3646+ StringBuilder& append (const char * s) { buf += s; return *this ; }
3647+ StringBuilder& append (char c) { buf += c; return *this ; }
3648+ StringBuilder& insert (int idx, const ::std::string& s) { buf.insert (idx,s); return *this ; }
3649+ StringBuilder& deleteCharAt (int idx) { buf.erase (idx,1 ); return *this ; }
3650+ StringBuilder& reverse () { ::std::reverse (buf.begin (),buf.end ()); return *this ; }
3651+ void setCharAt (int idx, char c) { buf[idx]=c; }
3652+ char charAt (int idx) const { return buf[idx]; }
3653+ int length () const { return (int )buf.size (); }
3654+ ::std::string toString () const { return buf; }
3655+ operator ::std::string () const { return buf; }
3656+ };
3657+
36383658// Java collection stubs
36393659template <class T >
36403660class HashSet {
You can’t perform that action at this time.
0 commit comments