123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599 |
- #pragma once
- #include <functional>
- #include <sstream>
- #include "Reader.h"
- #include "ReferenceCounter.h"
- namespace Framework
- {
- namespace Regex
- {
- class Result;
- class RegexConfig;
- }
- class DynamicBuffer : public std::stringbuf
- {
- private:
- std::function<int(std::stringbuf&)> onAppend;
- public:
- DLLEXPORT DynamicBuffer(std::function<int(std::stringbuf&)> onAppend);
- DLLEXPORT virtual int sync() override;
- };
- class FlushingOStream : public std::ostream
- {
- private:
- std::function<void()> onDestroy;
- public:
- DLLEXPORT FlushingOStream(
- DynamicBuffer* buffer, std::function<void()> onDestroy = []() {});
- DLLEXPORT FlushingOStream(const Framework::FlushingOStream& stream);
- DLLEXPORT ~FlushingOStream();
- };
-
- class Text : public virtual ReferenceCounter
- {
- private:
- char* txt;
- int length;
- char suchGBeg;
- char suchGEnd;
- int precision;
- DynamicBuffer* stringWriter;
- DLLEXPORT Text(char* txt, int l);
- public:
-
- DLLEXPORT Text();
-
-
- DLLEXPORT Text(const Text& txt);
-
-
- DLLEXPORT Text(const char* txt);
-
-
-
-
- DLLEXPORT Text(const char* txt, int offset, int length);
-
-
- DLLEXPORT Text(int zahl);
-
-
- DLLEXPORT Text(double num);
-
-
- DLLEXPORT Text(float num);
-
- DLLEXPORT ~Text();
- private:
- DLLEXPORT void setTextZ(char* t, int l);
- public:
-
- DLLEXPORT void toUpperCase();
-
- DLLEXPORT void toLowerCase();
-
-
-
- DLLEXPORT void setSuchGrenzen(char gBeg, char gEnd);
-
-
- DLLEXPORT void setText(const char* t);
-
-
-
- DLLEXPORT void setText(const char* t, int l);
-
-
- DLLEXPORT void setText(Text* t);
-
-
-
- DLLEXPORT void appendHex(char num);
-
-
-
- DLLEXPORT void appendHex(short num);
-
-
-
- DLLEXPORT void appendHex(int num);
-
-
-
- DLLEXPORT void appendHex(__int64 num);
-
-
- DLLEXPORT void append(char c);
-
-
-
- DLLEXPORT void append(const char* t);
-
-
-
- DLLEXPORT void append(const char* t, int l);
-
-
-
- DLLEXPORT void append(Text* t);
-
-
-
- DLLEXPORT void append(int num);
-
-
-
- DLLEXPORT void append(__int64 num);
-
-
-
- DLLEXPORT void append(unsigned int num);
-
-
-
- DLLEXPORT void append(double num);
-
-
-
- DLLEXPORT void append(float num);
-
- DLLEXPORT FlushingOStream append();
-
-
-
- DLLEXPORT void insert(int p, char c);
-
-
-
-
- DLLEXPORT void insert(int p, const char* t);
-
-
-
-
- DLLEXPORT void insert(int p, Text* t);
-
-
-
-
- DLLEXPORT void regexReplace(const char* regex,
- const char* replacement,
- Regex::RegexConfig* config = 0);
-
-
-
-
-
-
- DLLEXPORT void regexReplace(const char* regex,
- std::function<Text(Regex::Result&)> replacementFunction,
- Regex::RegexConfig* config = 0);
-
-
-
-
-
-
-
- DLLEXPORT void ersetzen(int p1, int p2, const char* t);
-
-
-
-
-
-
-
- DLLEXPORT void ersetzen(int p1, int p2, Text* t);
-
-
-
-
- DLLEXPORT void ersetzen(char c1, char c2);
-
-
-
-
- DLLEXPORT void ersetzen(const char* t1, const char* t2);
-
-
-
-
-
- DLLEXPORT void ersetzen(Text* t1, const char* t2);
-
-
-
-
-
- DLLEXPORT void ersetzen(const char* t1, Text* t2);
-
-
-
-
-
- DLLEXPORT void ersetzen(Text* t1, Text* t2);
-
-
-
-
-
-
- DLLEXPORT void ersetzen(int i, char c1, char c2);
-
-
-
-
-
-
- DLLEXPORT void ersetzen(int i, const char* t1, const char* t2);
-
-
-
-
-
-
- DLLEXPORT void ersetzen(int i, Text* t1, const char* t2);
-
-
-
-
-
-
- DLLEXPORT void ersetzen(int i, const char* t1, Text* t2);
-
-
-
-
-
-
- DLLEXPORT void ersetzen(int i, Text* t1, Text* t2);
-
-
-
-
- DLLEXPORT void fillText(char c, int length);
-
-
- DLLEXPORT void remove(int p);
-
-
-
-
- DLLEXPORT void remove(int p1, int p2);
-
-
- DLLEXPORT void remove(char c);
-
-
- DLLEXPORT void remove(const char* t);
-
-
- DLLEXPORT void remove(Text* t);
-
-
-
-
- DLLEXPORT void remove(int i, char c);
-
-
-
-
- DLLEXPORT void remove(int i, const char* t);
-
-
-
- DLLEXPORT void remove(int i, Text* t);
-
-
-
- DLLEXPORT int removeWhitespaceAfter(int pos);
-
-
-
- DLLEXPORT int removeWhitespaceBefore(int pos);
-
-
- DLLEXPORT void setPrecision(int p);
-
- DLLEXPORT int getLength() const;
-
-
- DLLEXPORT int getLKick(int pos) const;
-
-
- DLLEXPORT int getOKick(int pos) const;
-
-
- DLLEXPORT int getRKick(int pos) const;
-
-
- DLLEXPORT int getUKick(int pos) const;
-
-
-
- DLLEXPORT bool hat(Text* t) const;
-
-
-
- DLLEXPORT bool hat(const char* t) const;
-
-
-
-
- DLLEXPORT bool hat(int searchStartIndex, const char* t) const;
-
-
-
-
-
- DLLEXPORT bool hatAt(int pos, Text* t) const;
-
-
-
-
-
- DLLEXPORT bool hatAt(int pos, const char* t) const;
-
-
-
- DLLEXPORT bool hat(char c) const;
-
-
-
-
- DLLEXPORT bool istGleich(const char* t) const;
-
-
-
-
- DLLEXPORT bool istGleich(Text* t) const;
-
- DLLEXPORT const char* getText() const;
-
-
-
- DLLEXPORT int anzahlVon(char c) const;
-
-
-
- DLLEXPORT int anzahlVon(const char* t) const;
-
-
-
- DLLEXPORT int anzahlVon(Text* t) const;
-
-
-
- DLLEXPORT int positionVon(char c) const;
-
-
-
- DLLEXPORT int positionVon(const char* t) const;
-
-
-
-
- DLLEXPORT int positionVon(int searchStart, const char* t) const;
-
-
-
- DLLEXPORT int positionVon(Text* t) const;
-
-
-
-
- DLLEXPORT int positionVon(char c, int i) const;
-
-
-
-
- DLLEXPORT int positionVon(const char* t, int i) const;
-
-
-
-
- DLLEXPORT int positionVon(Text* t, int i) const;
-
-
-
-
- DLLEXPORT Text* getTeilText(int p1, int p2) const;
-
-
-
-
- DLLEXPORT Text* getTeilText(int p) const;
-
- DLLEXPORT int hashCode() const;
-
- DLLEXPORT Text& operator+=(const int num);
-
- DLLEXPORT Text& operator+=(const __int64 num);
-
- DLLEXPORT Text& operator+=(const double num);
-
- DLLEXPORT Text& operator+=(const float num);
-
- DLLEXPORT Text& operator+=(const char* txt);
-
- DLLEXPORT Text& operator+=(const Text& txt);
-
- DLLEXPORT Text& operator=(const int num);
-
- DLLEXPORT Text& operator=(const double num);
-
- DLLEXPORT Text& operator=(const float num);
-
- DLLEXPORT Text& operator=(const char* txt);
-
-
- DLLEXPORT Text& operator=(const Text& txt);
-
- DLLEXPORT operator const char*() const;
-
- DLLEXPORT explicit operator int() const;
-
- DLLEXPORT explicit operator __int64() const;
-
- DLLEXPORT explicit operator double() const;
-
- DLLEXPORT explicit operator float() const;
-
-
- DLLEXPORT bool operator>(Text& t) const;
-
-
- DLLEXPORT bool operator<(Text& t) const;
-
- DLLEXPORT Text operator+(const Text& t2) const;
-
- DLLEXPORT Text operator+(const char* t2) const;
-
- DLLEXPORT Text operator+(const int num) const;
-
- DLLEXPORT Text operator+(const __int64 num) const;
-
- DLLEXPORT Text operator+(const double num) const;
-
- DLLEXPORT Text operator+(const float num) const;
-
- DLLEXPORT bool operator==(const Text& right) const;
- };
- class TextReader : public Reader,
- public virtual ReferenceCounter
- {
- private:
- Text* txt;
- __int64 lPos;
- public:
-
-
-
- DLLEXPORT TextReader(Text* txt);
-
- DLLEXPORT virtual ~TextReader();
-
-
-
-
- DLLEXPORT void setLPosition(__int64 pos, bool ende) override;
-
-
-
- DLLEXPORT void lese(char* bytes, int len) override;
-
-
- DLLEXPORT Text* leseZeile() override;
-
-
- DLLEXPORT bool istEnde() const override;
-
-
-
- DLLEXPORT __int64 getLPosition() const override;
-
- DLLEXPORT __int64 getSize() const override;
- };
-
-
-
-
-
-
- DLLEXPORT int stringPositionVonChar(const char* string,
- char c,
- int num);
-
-
-
-
-
-
-
- DLLEXPORT int stringPositionVonString(
- const char* string, char* suche, int sBegPos);
-
-
- DLLEXPORT void TextKopieren(const char* txt);
-
-
-
-
- DLLEXPORT const char* TextInsert();
-
-
-
-
-
- DLLEXPORT char smallOrBig(char c, bool big);
-
-
-
-
- DLLEXPORT bool istSchreibbar(unsigned char zeichen);
-
-
-
- DLLEXPORT unsigned int TextZuInt(const char* c, int system);
-
-
-
-
-
-
- DLLEXPORT unsigned int TextZuInt(const char* c, char** c_ende, int system);
-
-
-
- DLLEXPORT unsigned __int64 TextZuInt64(const char* c, int system);
-
-
-
-
-
-
- DLLEXPORT unsigned __int64 TextZuInt64(
- const char* c, char** c_ende, int system);
-
-
-
- DLLEXPORT double TextZuDouble(const char* c);
-
-
-
- DLLEXPORT float TextZuFloat(const char* c);
-
-
-
-
-
- DLLEXPORT double TextZuDouble(const char* c, char** c_ende);
-
-
-
-
-
- DLLEXPORT float TextZuFloat(const char* c, char** c_ende);
-
-
-
- DLLEXPORT int textLength(const char* txt);
- }
|