Public Types | Public Member Functions

String Struct Reference

string class for TCHAR strings More...

#include <utility.h>

Inheritance diagram for String:
Inheritance graph
[legend]
Collaboration diagram for String:
Collaboration graph
[legend]

List of all members.

Public Types

typedef string super

Public Member Functions

 String ()
 String (LPCTSTR s)
 String (LPCTSTR s, int l)
 String (const super &other)
 String (const String &other)
 String (LPCWSTR s)
 String (LPCWSTR s, int l)
 String (const wstring &other)
String & operator= (LPCWSTR s)
void assign (LPCWSTR s)
void assign (LPCWSTR s, int l)
void assign (const BStr &s)
 String (const BStr &s)
String & operator= (const BStr &s)
String & operator= (LPCTSTR s)
String & operator= (const super &s)
void assign (LPCTSTR s)
void assign (LPCTSTR s, int l)
 operator LPCTSTR () const
 operator wstring () const
LPTSTR str ()
String & printf (LPCTSTR fmt,...)
 return modifyable character string pointer
String & vprintf (LPCTSTR fmt, va_list l)
String & appendf (LPCTSTR fmt,...)
String & vappendf (LPCTSTR fmt, va_list l)
void toLower ()

Detailed Description

string class for TCHAR strings

Definition at line 784 of file utility.h.


Member Typedef Documentation

Definition at line 794 of file utility.h.


Constructor & Destructor Documentation

String::String (  ) [inline]

Definition at line 797 of file utility.h.

{}
String::String ( LPCTSTR  s ) [inline]

Definition at line 799 of file utility.h.

{if (s) super::assign(s);}
String::String ( LPCTSTR  s,
int  l 
) [inline]

Definition at line 800 of file utility.h.

: super(s, l) {}
String::String ( const super &  other ) [inline]

Definition at line 802 of file utility.h.

: super(other) {}
String::String ( const String &  other ) [inline]

Definition at line 803 of file utility.h.

: super(other) {}
String::String ( LPCWSTR  s ) [inline]

Definition at line 814 of file utility.h.

{assign(s);}
String::String ( LPCWSTR  s,
int  l 
) [inline]

Definition at line 815 of file utility.h.

{assign(s, l);}
String::String ( const wstring &  other ) [inline]

Definition at line 816 of file utility.h.

{assign(other.c_str());}
String::String ( const BStr &  s ) [inline]

Definition at line 822 of file utility.h.

{assign(s);}

Member Function Documentation

String& String::appendf ( LPCTSTR  fmt,
  ... 
) [inline]

Definition at line 861 of file utility.h.

References _vsntprintf, BUFFER_LEN, and COUNTOF.

Referenced by Context::toString().

    {
        va_list l;
        TCHAR b[BUFFER_LEN];

        va_start(l, fmt);
        super::append(b, _vsntprintf(b, COUNTOF(b), fmt, l));
        va_end(l);

        return *this;
    }

Here is the caller graph for this function:

void String::assign ( const BStr &  s ) [inline]

Definition at line 820 of file utility.h.

References BUFFER_LEN, and BStr::length().

{int l = s.length(); if (l) {char b[BUFFER_LEN]; super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, l, b, BUFFER_LEN, 0, 0));} else erase();}

Here is the call graph for this function:

void String::assign ( LPCTSTR  s ) [inline]

Definition at line 827 of file utility.h.

void String::assign ( LPCTSTR  s,
int  l 
) [inline]

Definition at line 828 of file utility.h.

{super::assign(s, l);}
void String::assign ( LPCWSTR  s ) [inline]

Definition at line 818 of file utility.h.

References BUFFER_LEN.

Referenced by HyperlinkCtrl::init(), NotifyInfo::modify(), NotifyHook::ModulePathCopyData(), and ResString::ResString().

{if (s) {char b[BUFFER_LEN]; super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, -1, b, BUFFER_LEN, 0, 0)-1);} else erase();}

Here is the caller graph for this function:

void String::assign ( LPCWSTR  s,
int  l 
) [inline]

Definition at line 819 of file utility.h.

References BUFFER_LEN.

{if (s) {char b[BUFFER_LEN]; super::assign(b, WideCharToMultiByte(CP_ACP, 0, s, l, b, BUFFER_LEN, 0, 0));} else erase();}
String::operator LPCTSTR (  ) const [inline]

Definition at line 830 of file utility.h.

{return c_str();}
String::operator wstring (  ) const [inline]

Definition at line 835 of file utility.h.

References BUFFER_LEN.

{WCHAR b[BUFFER_LEN]; return wstring(b, MultiByteToWideChar(CP_ACP, 0, c_str(), -1, b, BUFFER_LEN)-1);}
String& String::operator= ( const super &  s ) [inline]

Definition at line 826 of file utility.h.

{super::assign(s); return *this;}
String& String::operator= ( LPCWSTR  s ) [inline]

Definition at line 817 of file utility.h.

{assign(s); return *this;}
String& String::operator= ( const BStr &  s ) [inline]

Definition at line 823 of file utility.h.

{assign(s); return *this;}
String& String::operator= ( LPCTSTR  s ) [inline]

Definition at line 825 of file utility.h.

{if (s) super::assign(s); else erase(); return *this;}
String& String::printf ( LPCTSTR  fmt,
  ... 
) [inline]

return modifyable character string pointer

Definition at line 840 of file utility.h.

References _vsntprintf, BUFFER_LEN, and COUNTOF.

Referenced by MDIShellBrowserChild::entry_selected(), SDIMainFrame::entry_selected(), get_windows_version_str(), ExplorerGlobals::read_persistent(), TrayNotifyDlg::RefreshProperties(), and SplitFileSysURL().

    {
        va_list l;
        TCHAR b[BUFFER_LEN];

        va_start(l, fmt);
        super::assign(b, _vsntprintf(b, COUNTOF(b), fmt, l));
        va_end(l);

        return *this;
    }

Here is the caller graph for this function:

LPTSTR String::str (  ) [inline]

Definition at line 838 of file utility.h.

Referenced by MainFrameBase::FillBookmarks(), TrayNotifyDlg::InsertItem(), NotifyArea::Notify(), and TrayNotifyDlg::Refresh().

{return (LPTSTR)data();}    /// return modifyable character string pointer

Here is the caller graph for this function:

void String::toLower (  ) [inline]

Definition at line 882 of file utility.h.

Referenced by FindProgramDlg::add_entry(), FavoritesMenu::AddEntries(), StartMenu::AddShellEntries(), and FileTypeManager::operator[]().

    {
        if (!empty())
            CharLower(str());
    }

Here is the caller graph for this function:

String& String::vappendf ( LPCTSTR  fmt,
va_list  l 
) [inline]

Definition at line 873 of file utility.h.

References _vsntprintf, BUFFER_LEN, and COUNTOF.

    {
        TCHAR b[BUFFER_LEN];

        super::append(b, _vsntprintf(b, COUNTOF(b), fmt, l));

        return *this;
    }
String& String::vprintf ( LPCTSTR  fmt,
va_list  l 
) [inline]

Definition at line 852 of file utility.h.

References _vsntprintf, BUFFER_LEN, and COUNTOF.

    {
        TCHAR b[BUFFER_LEN];

        super::assign(b, _vsntprintf(b, COUNTOF(b), fmt, l));

        return *this;
    }

The documentation for this struct was generated from the following file:

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage