~brandontschaefer/nux/xim-tests

« back to all changes in this revision

Viewing changes to NuxCore/FileName.h

  • Committer: Brandon Schaefer
  • Date: 2012-10-19 00:23:27 UTC
  • mfrom: (637.2.55 trunk)
  • Revision ID: brandon.schaefer@canonical.com-20121019002327-60e88jn3k8chi7gt
* Merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
namespace nux
29
29
{
30
30
 
31
 
  class NFileName : public NString
 
31
  class NFileName : public std::string
32
32
  {
33
33
  public:
34
34
    NFileName()
35
 
      : NString()
 
35
      : std::string()
36
36
    {}
37
37
    NFileName ( const NFileName &Filename )
38
 
      : NString ( Filename.GetTCharPtr() )
 
38
      : std::string ( Filename )
39
39
    {}
40
40
 
41
 
    NFileName ( const NString &str )
42
 
      : NString ( str )
 
41
    NFileName ( const std::string &str )
 
42
      : std::string ( str )
43
43
    {}
44
44
 
45
45
    NFileName ( const ANSICHAR *str )
46
 
      : NString ( str )
47
 
    {}
48
 
    NFileName ( const UNICHAR *str )
49
 
      : NString ( str )
 
46
      : std::string ( str )
50
47
    {}
51
48
 
52
49
    //! Replace all slash with backslash.
75
72
    //! Replace all slash with backslash. Replace multiple consecutive backslash with one backslash.
76
73
    void ConvertToCleanBackslash();
77
74
 
78
 
    NString GetDrive() const;
 
75
    std::string GetDrive() const;
79
76
    //! Returns the text following the last period.
80
 
    NString GetExtension() const;
 
77
    std::string GetExtension() const;
81
78
    //! Returns the base filename, minus any path information.
82
 
    NString GetCleanFilename() const;
 
79
    std::string GetCleanFilename() const;
83
80
    //! Returns the base filename, without the extension (keep the path)
84
 
    NString GetFilenameNoExtension() const;
 
81
    std::string GetFilenameNoExtension() const;
85
82
 
86
83
    //! Returns the same thing as GetCleanFilename, but without the extension
87
 
    NString GetBaseFilename() const;
 
84
    std::string GetBaseFilename() const;
88
85
    //! Returns the path in front of the filename
89
 
    NString GetDirectoryPath() const;
 
86
    std::string GetDirectoryPath() const;
90
87
    //! Change the file extension. Do not start ext with a dot character '.'.
91
88
    //! ie ext = "com"
92
89
    void ChangeFileExtension (const TCHAR *ext);