• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • tdecore
tdestandarddirs.h
1/*
2 This file is part of the TDE libraries
3 Copyright (C) 1999 Sirtaj Singh Kang <taj@kde.org>
4 Copyright (C) 1999 Stephan Kulow <coolo@kde.org>
5 Copyright (C) 1999 Waldo Bastian <bastian@kde.org>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
21*/
22
23#ifndef _TDESTANDARDDIRS_H
24#define _TDESTANDARDDIRS_H
25
26#include <tqstring.h>
27#include <tqdict.h>
28#include <tqstringlist.h>
29#include <tdeglobal.h>
30
31class TDEConfig;
32class TDEStandardDirsPrivate;
33
125class TDECORE_EXPORT TDEStandardDirs
126{
127public:
131 TDEStandardDirs( );
132
136 virtual ~TDEStandardDirs();
137
147 void addPrefix( const TQString& dir );
148
156 void addXdgConfigPrefix( const TQString& dir );
157
165 void addXdgDataPrefix( const TQString& dir );
166
186 bool addResourceType( const char *type,
187 const TQString& relativename );
188
204 bool addResourceDir( const char *type,
205 const TQString& absdir);
206
225 TQString findResource( const char *type,
226 const TQString& filename ) const;
227
243 bool isRestrictedResource( const char *type,
244 const TQString& relPath=TQString::null ) const;
245
258 TQ_UINT32 calcResourceHash( const char *type,
259 const TQString& filename, bool deep) const;
260
277 TQStringList findDirs( const char *type,
278 const TQString& reldir ) const;
279
300 TQString findResourceDir( const char *type,
301 const TQString& filename) const;
302
303
323 TQStringList findAllResources( const char *type,
324 const TQString& filter = TQString::null,
325 bool recursive = false,
326 bool unique = false) const;
327
350 TQStringList findAllResources( const char *type,
351 const TQString& filter,
352 bool recursive,
353 bool unique,
354 TQStringList &relPaths) const;
355
365 static TQStringList systemPaths( const TQString& pstr=TQString::null );
366
384 static TQString findExe( const TQString& appname,
385 const TQString& pathstr=TQString::null,
386 bool ignoreExecBit=false );
387
406 static int findAllExe( TQStringList& list, const TQString& appname,
407 const TQString& pathstr=TQString::null,
408 bool ignoreExecBit=false );
409
419 void addKDEDefaults();
420
430 bool addCustomized(TDEConfig *config);
431
443 TQStringList resourceDirs(const char *type) const;
444
451 TQStringList allTypes() const;
452
470 TQString saveLocation(const char *type,
471 const TQString& suffix = TQString::null,
472 bool create = true) const;
473
489 TQString relativeLocation(const char *type, const TQString &absPath);
490
501 static bool makeDir(const TQString& dir, int mode = 0755);
502
530 static TQString kde_default(const char *type);
531
535 TQString kfsstnd_prefixes();
536
540 TQString kfsstnd_xdg_conf_prefixes();
541
545 TQString kfsstnd_xdg_data_prefixes();
546
553 TQString localtdedir() const;
554
559 static TQString kfsstnd_defaultprefix();
560
565 static TQString kfsstnd_defaultbindir();
566
571 TQString localxdgdatadir() const;
572
577 TQString localxdgconfdir() const;
578
586 static bool exists(const TQString &fullPath);
587
596 static TQString realPath(const TQString &dirname);
597
606 static TQString realFilePath(const TQString &filename);
607
608 private:
609
610 TQStringList prefixes;
611
612 // Directory dictionaries
613 TQDict<TQStringList> absolutes;
614 TQDict<TQStringList> relatives;
615
616 mutable TQDict<TQStringList> dircache;
617 mutable TQDict<TQString> savelocations;
618
619 // Disallow assignment and copy-construction
620 TDEStandardDirs( const TDEStandardDirs& );
621 TDEStandardDirs& operator= ( const TDEStandardDirs& );
622
623 bool addedCustoms;
624
625 class TDEStandardDirsPrivate;
626 TDEStandardDirsPrivate *d;
627
628 void checkConfig() const;
629 void applyDataRestrictions(const TQString &) const;
630 void createSpecialResource(const char*);
631
632 // Like their public counter parts but with an extra priority argument
633 // If priority is true, the directory is added directly after
634 // $TDEHOME/$XDG_DATA_HOME/$XDG_CONFIG_HOME
635 void addPrefix( const TQString& dir, bool priority );
636 void addXdgConfigPrefix( const TQString& dir, bool priority );
637 void addXdgDataPrefix( const TQString& dir, bool priority );
638
639 // If priority is true, the directory is added before any other,
640 // otherwise after
641 bool addResourceType( const char *type,
642 const TQString& relativename, bool priority );
643 bool addResourceDir( const char *type,
644 const TQString& absdir, bool priority);
645};
646
703TDECORE_EXPORT TQString locate( const char *type, const TQString& filename, const TDEInstance* instance = TDEGlobal::instance() );
704
714TDECORE_EXPORT TQString locateLocal( const char *type, const TQString& filename, const TDEInstance* instance = TDEGlobal::instance() );
715
725TDECORE_EXPORT TQString locateLocal( const char *type, const TQString& filename, bool createDir, const TDEInstance* instance = TDEGlobal::instance() );
726
729#endif // _TDESTANDARDDIRS_H
TDEConfig
Access KDE Configuration entries.
Definition: tdeconfig.h:44
TDEGlobal::instance
static TDEInstance * instance()
Returns the global instance.
Definition: tdeglobal.cpp:102
TDEInstance
Access to KDE global objects for use in shared libraries.
Definition: kinstance.h:48
TDEStandardDirs
Site-independent access to standard TDE directories.
Definition: tdestandarddirs.h:126
TDEStandardDirs::locate
TQString locate(const char *type, const TQString &filename, const TDEInstance *instance=TDEGlobal::instance())
Definition: tdestandarddirs.cpp:1689
TDEStandardDirs::locateLocal
TQString locateLocal(const char *type, const TQString &filename, const TDEInstance *instance=TDEGlobal::instance())
Definition: tdestandarddirs.cpp:1695

tdecore

Skip menu "tdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.