Home > Back-end >  How do you break down TStringStream object
How do you break down TStringStream object

Time:02-08

A=new TStringStream TStringStream * (" ", TEncoding: : UTF8, true);

How to decompose the
For example:
A=new TStringStream TStringStream * ();
.
A - & gt; Encoding...

CodePudding user response:

Check the Help, see TStringStream: what are the class constructor and member function, the first method is to use the constructor, generally only provide initialization, if a member function is not available, because can't change after initialization,

CodePudding user response:

Constructor can see the Create function, is the Delphi constructor,

CodePudding user response:

The class PASCALIMPLEMENTATION TStringStream: public TBytesStream
{
Typedef TBytesStream inherited;

Private:
System: : Sysutils: : TEncoding * FEncoding;
Bool FOwnsEncoding;
System: : UnicodeString __fastcall GetDataString (void);

Public:
__fastcall TStringStream phrase (void)/* */.
__fastcall TStringStream (const System: : UnicodeString AString) phrase/* */;
__fastcall TStringStream (const System: : RawByteString AString) phrase/* */;
__fastcall TStringStream (const System: : UnicodeString AString, System: : Sysutils: : TEncoding * AEncoding, bool AOwnsEncoding) phrase/* */;
__fastcall TStringStream (const System: : UnicodeString AString, int ACodePage) phrase/* */;
# # ifndef _WIN64
__fastcall TStringStream (const System: : DynamicArray ABytes)/* overload */;
_WIN64 # else/* */
__fastcall TStringStream (const System: : TArray__1 & lt; System: : Byte> ABytes)/* overload */;
# endif _WIN64/* */
__fastcall virtual ~ TStringStream (void);
System: : UnicodeString __fastcall ReadString (int Count);
Void __fastcall WriteString (const System: : UnicodeString AString);
__property System: : UnicodeString DataString={read=GetDataString};
__property System: : Sysutils: : TEncoding * Encoding={read=FEncoding};
};

CodePudding user response:

__property System: : Sysutils: : TEncoding * Encoding={read=FEncoding};
Encoding is a property and read-only,

CodePudding user response:

The
reference 4 floor ooolinux reply:
__property System: : Sysutils: : TEncoding * Encoding={read=FEncoding};
Encoding is a property and read-only,

That is to say, a - & gt; Encoding can only be placed on the right hand side,

CodePudding user response:

A=new TMemoryStream TMemoryStream * ();
.
NetHTTPClient1 - & gt; Get (" http://login.tq.cn/vip/", a - & gt; Encoding);
RichEdit1 - & gt; Lines - & gt; Add (a - & gt; DataString);

I like this not line, a lot of mistakes, please correct me by predecessors,

CodePudding user response:

refer to 6th floor qq_448571358 response:
TMemoryStream * a=new TMemoryStream ();
.
NetHTTPClient1 - & gt; Get (" http://login.tq.cn/vip/", a - & gt; Encoding);
RichEdit1 - & gt; Lines - & gt; Add (a - & gt; DataString);

I'm not good at writing, a lot of mistakes, please correct me by predecessors,


TMemoryStream Encoding attribute?

CodePudding user response:

refer to 7th floor ooolinux response:
Quote: refer to the sixth floor qq_448571358 response:

A=new TMemoryStream TMemoryStream * ();
.
NetHTTPClient1 - & gt; Get (" http://login.tq.cn/vip/", a - & gt; Encoding);
RichEdit1 - & gt; Lines - & gt; Add (a - & gt; DataString);

I'm not good at writing, a lot of mistakes, please correct me by predecessors,


TMemoryStream Encoding attribute?


Mainly be garbled

CodePudding user response:

Use TStringStream, rather than TMemoryStream,

CodePudding user response:

A=new TStringStream TStringStream * ();
NetHTTPClient1 - & gt; AcceptCharSet="utf-8";
NetHTTPClient1 - & gt; AcceptEncoding="65001";
NetHTTPClient1 - & gt; AcceptLanguage="useful - cn";
NetHTTPClient1 - & gt; ContentType="text/HTML. Charset=utf-8 ";
NetHTTPClient1 - & gt; UserAgent="Embarcadero URL Client/1.0";
NetHTTPClient1 - & gt; Get (" http://login.tq.cn/vip/", a);
RichEdit1 - & gt; Lines - & gt; Add (a - & gt; DataString);

So there will be a local garbled don't know why

CodePudding user response:

You is not the earliest written:
A=new TStringStream TStringStream * (" ", TEncoding: : UTF8, true);

CodePudding user response:

I just want to put the TStringStream (... The parameters of the decomposition),

CodePudding user response:

The
refer to 12 floor qq_448571358 reply:
I just want to put TStringStream (... The parameters of the decomposition),

Different constructor, just work,

CodePudding user response:

Oh, thank you,
  • Related