diff options
Diffstat (limited to 'l10ntools/inc/l10ntools')
-rw-r--r-- | l10ntools/inc/l10ntools/directory.hxx | 54 | ||||
-rw-r--r-- | l10ntools/inc/l10ntools/file.hxx | 23 | ||||
-rw-r--r-- | l10ntools/inc/l10ntools/vosapp.hxx | 33 |
3 files changed, 110 insertions, 0 deletions
diff --git a/l10ntools/inc/l10ntools/directory.hxx b/l10ntools/inc/l10ntools/directory.hxx new file mode 100644 index 000000000000..6b71f59435f7 --- /dev/null +++ b/l10ntools/inc/l10ntools/directory.hxx @@ -0,0 +1,54 @@ +#include <vector> +#include <algorithm> +#include <rtl/ustring.hxx> +#include <tools/string.hxx> + +#ifdef WNT +#else +#include <dirent.h> +#include <unistd.h> +#include <sys/stat.h> +#endif + +#include <stdio.h> + +#ifndef L10NTOOLS_FILE_HXX +#define L10NTOOLS_FILE_HXX +#include <l10ntools/file.hxx> +#endif + +namespace transex{ + +class Directory +{ + private: + rtl::OUString sDirectoryName; + rtl::OUString sFullName; + bool bSkipLinks; + + std::vector<Directory> aDirVec; + std::vector<File> aFileVec; + + public: + std::vector<Directory> getSubDirectories() { return aDirVec; } + std::vector<File> getFiles() { return aFileVec; } + + void readDirectory(); + void readDirectory( const rtl::OUString& sFullpath ); + void scanSubDir( int nLevels = 0 ); + + rtl::OUString getDirectoryName() { return sDirectoryName; } + rtl::OUString getFullName() { return sFullName ; } + void setSkipLinks( bool is_skipped ); + + void dump(); + Directory(){}; + + Directory( const rtl::OUString sFullPath ); + Directory( const rtl::OUString sFullPath , const rtl::OUString sEntry ) ; + Directory( const ByteString sFullPath ); + + static bool lessDir ( const Directory& rKey1, const Directory& rKey2 ) ; +}; + +} diff --git a/l10ntools/inc/l10ntools/file.hxx b/l10ntools/inc/l10ntools/file.hxx new file mode 100644 index 000000000000..e3a1a46b4ee8 --- /dev/null +++ b/l10ntools/inc/l10ntools/file.hxx @@ -0,0 +1,23 @@ +#include "rtl/ustring.hxx" + +namespace transex +{ + +class File +{ + private: + rtl::OUString sFileName; + rtl::OUString sFullName; + + public: + rtl::OUString getFileName(){ return sFileName; } + rtl::OUString getFullName(){ return sFullName; } + + File( const rtl::OUString sFile ); + File( const rtl::OUString sFullName , const rtl::OUString sFile ); + + static bool lessFile ( const File& rKey1, const File& rKey2 ); + +}; + +} diff --git a/l10ntools/inc/l10ntools/vosapp.hxx b/l10ntools/inc/l10ntools/vosapp.hxx new file mode 100644 index 000000000000..49e10e15e3d4 --- /dev/null +++ b/l10ntools/inc/l10ntools/vosapp.hxx @@ -0,0 +1,33 @@ +#ifndef VOSAPP_HXX +#define VOSAPP_HXX + +#include <sal/main.h> +#include <tools/solar.h> +#include <tools/string.hxx> +#include <vos/process.hxx> + +// Mininmal vcl/svapp compatibility without vcl dependence +class Application +{ +public: + USHORT GetCommandLineParamCount(); + XubString GetCommandLineParam( USHORT nParam ); + virtual void Main() = 0; +}; + +// Urg: Cut & Paste from svapp.cxx: we don't want to depend on vcl +USHORT Application::GetCommandLineParamCount() +{ + vos::OStartupInfo aStartInfo; + return (USHORT)aStartInfo.getCommandArgCount(); +} + +XubString Application::GetCommandLineParam( USHORT nParam ) +{ + vos::OStartupInfo aStartInfo; + rtl::OUString aParam; + aStartInfo.getCommandArg( nParam, aParam ); + return XubString( aParam ); +} + +#endif /* VOSAPP_HXX */ |