39 #define G_OPEN "GUrlString::open(std::string&, std::string&)"
254 if (buffer != NULL && nbyte > 0) {
266 nread = (nbyte < nremain) ? nbyte : nremain;
270 char* dst =
reinterpret_cast<char*
>(buffer);
271 for (
int i = 0; i < nread; ++i) {
311 if (buffer != NULL && nbyte > 0) {
315 sbuffer.reserve(nbyte);
316 const char* src =
reinterpret_cast<const char*
>(buffer);
317 for (
int i = 0; i < nbyte; ++i) {
318 sbuffer.push_back(*src++);
416 std::va_list arg_ptr;
419 va_start(arg_ptr, format);
425 vsscanf(src, format, arg_ptr);
457 std::memset(&buffer, 0,
sizeof(buffer));
460 std::va_list arg_ptr;
463 va_start(arg_ptr, format);
466 std::vsprintf(buffer, format, arg_ptr);
472 std::string sbuffer = std::string(buffer);
475 int nwritten = sbuffer.length();
501 result.append(
"=== GUrlString ===");
virtual int read(void *buffer, const int &nbyte)
Read block of data from string buffer.
GUrlString & operator=(const GUrlString &url)
Assignment operator.
virtual void printf(const char *format,...)
Write formatted data into string.
void free_members(void)
Delete class members.
std::string m_buffer
Text string.
virtual void scanf(const char *format,...)
Read formatted data from string.
GUrl & operator=(const GUrl &url)
Assignment operator.
void copy_members(const GUrlString &url)
Copy class members.
virtual void put_char(const int &character)
Write character into string.
virtual int get_char(void) const
Return next character from string.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print URL information.
virtual void clear(void)
Clear string URL.
virtual void close(void)
Close file.
void free_members(void)
Delete class members.
GUrlString(void)
Void constructor.
const std::string & string(void) const
int m_index
String position indicator.
Exception handler interface definition.
virtual void open(const std::string &string, const std::string &mode="")
Open string URL.
virtual GUrlString * clone(void) const
Clone string URL.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
void init_members(void)
Initialise class members.
String URL class interface definition.
virtual ~GUrlString(void)
Destructor.
void init_members(void)
Initialise class members.
virtual int write(const void *buffer, const int &nbyte)
Write block of data buffer into string.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.