]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/fs_path.h
Fix MSYS2 issues
[xonotic/netradiant.git] / libs / fs_path.h
index df409ef0bdae26520ea85b9b1d66086f4d5f3819..2baf297ed803f9fa1d3dd4085cb7169b24444872 100644 (file)
@@ -1,25 +1,25 @@
 /*
-Copyright (C) 2001-2006, William Joseph.
-All Rights Reserved.
+   Copyright (C) 2001-2006, William Joseph.
+   All Rights Reserved.
 
-This file is part of GtkRadiant.
+   This file is part of GtkRadiant.
 
-GtkRadiant is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+   GtkRadiant is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
 
-GtkRadiant is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   GtkRadiant is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-You should have received a copy of the GNU General Public License
-along with GtkRadiant; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-*/
+   You should have received a copy of the GNU General Public License
+   along with GtkRadiant; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
 
-#if !defined(INCLUDED_FS_PATH_H)
+#if !defined( INCLUDED_FS_PATH_H )
 #define INCLUDED_FS_PATH_H
 
 #include "stream/stringstream.h"
@@ -30,63 +30,53 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 /// - Provides a limited STL-style interface to push and pop file or directory names at the end of the path.
 class UnixPath
 {
-  StringBuffer m_string;
+StringBuffer m_string;
 
-  void check_separator()
-  {
-    if(!empty() && m_string.back() != '/')
-    {
-      m_string.push_back('/');
-    }
-  }
+void check_separator(){
+       if ( !empty() && m_string.back() != '/' ) {
+               m_string.push_back( '/' );
+       }
+}
 
 public:
-  /// \brief Constructs with the directory \p root.
-  UnixPath(const char* root)
-    : m_string(root)
-  {
-    check_separator();
-  }
+/// \brief Constructs with the directory \p root.
+UnixPath( const char* root )
+       : m_string( root ){
+       check_separator();
+}
 
-  bool empty() const
-  {
-    return m_string.empty();
-  }
+bool empty() const {
+       return m_string.empty();
+}
 
-  const char* c_str() const
-  {
-    return m_string.c_str();
-  }
+const char* c_str() const {
+       return m_string.c_str();
+}
 
-  /// \brief Appends the directory \p name.
-  void push(const char* name)
-  {
-    m_string.push_string(name);
-    check_separator();
-  }
-  /// \brief Appends the directory [\p first, \p last).
-  void push(const char* first, const char* last)
-  {
-    m_string.push_range(first, last);
-    check_separator();
-  }
-  /// \brief Appends the filename \p name.
-  void push_filename(const char* name)
-  {
-    m_string.push_string(name);
-  }
-  /// \brief Removes the last directory or filename appended.
-  void pop()
-  {
-    if(m_string.back() == '/')
-    {
-      m_string.pop_back();
-    }
-    while(!empty() && m_string.back() != '/')
-    {
-      m_string.pop_back();
-    }
-  }
+/// \brief Appends the directory \p name.
+void push( const char* name ){
+       m_string.push_string( name );
+       check_separator();
+}
+/// \brief Appends the directory [\p first, \p last).
+void push( const char* first, const char* last ){
+       m_string.push_range( first, last );
+       check_separator();
+}
+/// \brief Appends the filename \p name.
+void push_filename( const char* name ){
+       m_string.push_string( name );
+}
+/// \brief Removes the last directory or filename appended.
+void pop(){
+       if ( m_string.back() == '/' ) {
+               m_string.pop_back();
+       }
+       while ( !empty() && m_string.back() != '/' )
+       {
+               m_string.pop_back();
+       }
+}
 };
 
 #endif