You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
119 lines
3.5 KiB
119 lines
3.5 KiB
15 years ago
|
/////////////////////////////////////////////////////////////////////////////
|
||
|
//
|
||
12 years ago
|
// Project: SMB tdeioslave for KDE2
|
||
15 years ago
|
//
|
||
12 years ago
|
// File: tdeio_smb_internal.h
|
||
15 years ago
|
//
|
||
|
// Abstract: Utility classes used by SMBSlave
|
||
|
//
|
||
|
// Author(s): Matthew Peterson <mpeterson@caldera.com>
|
||
|
// Frank Schwanz <schwanz@fh-brandenburg.de>
|
||
|
//---------------------------------------------------------------------------
|
||
|
//
|
||
|
// Copyright (c) 2000 Caldera Systems, Inc.
|
||
|
//
|
||
|
// This program 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.1 of the License, or
|
||
|
// (at your option) any later version.
|
||
|
//
|
||
|
// This program 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 Lesser General Public License for more details.
|
||
|
//
|
||
|
// You should have received a copy of the GNU General Public License
|
||
|
// along with this program; see the file COPYING. If not, please obtain
|
||
|
// a copy from http://www.gnu.org/copyleft/gpl.html
|
||
|
//
|
||
|
/////////////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
#ifndef KIO_SMB_INTERNAL_H_INCLUDED
|
||
|
#define KIO_SMB_INTERNAL_H_INCLUDED
|
||
|
|
||
12 years ago
|
#include <tdeio/authinfo.h>
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Types of a SMBURL :
|
||
|
* SMBURLTYPE_UNKNOWN - Type could not be determined. Bad SMB Url.
|
||
|
* SMBURLTYPE_ENTIRE_NETWORK - "smb:/" is entire network
|
||
|
* SMBURLTYPE_WORKGROUP_OR_SERVER - "smb:/mygroup" or "smb:/myserver"
|
||
|
* URLTYPE_SHARE_OR_PATH - "smb:/mygroupe/mymachine/myshare/mydir"
|
||
|
*/
|
||
|
enum SMBUrlType {
|
||
|
SMBURLTYPE_UNKNOWN = 0, SMBURLTYPE_ENTIRE_NETWORK = 1,
|
||
|
SMBURLTYPE_WORKGROUP_OR_SERVER = 2, SMBURLTYPE_SHARE_OR_PATH = 3
|
||
|
};
|
||
|
|
||
|
|
||
|
//===========================================================================
|
||
|
/**
|
||
|
* Class to handle URL's
|
||
|
* it can convert KURL to smbUrl
|
||
|
* and Handle UserInfo
|
||
|
* it also check the correctness of the URL
|
||
|
*/
|
||
|
class SMBUrl : public KURL
|
||
|
{
|
||
|
|
||
|
|
||
|
public:
|
||
|
SMBUrl();
|
||
|
SMBUrl(const KURL & kurl);
|
||
|
|
||
|
/**
|
||
|
* Appends the specified file and dir to this SMBUrl
|
||
|
* "smb://server/share" --> "smb://server/share/filedir"
|
||
|
*/
|
||
15 years ago
|
void addPath(const TQString &filedir);
|
||
15 years ago
|
|
||
15 years ago
|
bool cd(const TQString &dir);
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Returns the type of this SMBUrl:
|
||
|
* SMBURLTYPE_UNKNOWN - Type could not be determined. Bad SMB Url.
|
||
|
* SMBURLTYPE_ENTIRE_NETWORK - "smb:/" is entire network
|
||
|
* SMBURLTYPE_WORKGROUP_OR_SERVER - "smb:/mygroup" or "smb:/myserver"
|
||
|
* URLTYPE_SHARE_OR_PATH - "smb:/mygroupe/mymachine/myshare/mydir"
|
||
|
*/
|
||
|
SMBUrlType getType() const;
|
||
|
|
||
15 years ago
|
void setPass( const TQString& _txt ) { KURL::setPass(_txt); updateCache(); }
|
||
|
void setUser( const TQString& _txt ) { KURL::setUser(_txt); updateCache(); }
|
||
|
void setHost( const TQString& _txt ) { KURL::setHost(_txt); updateCache(); }
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Returns the workgroup if it given in url
|
||
|
*/
|
||
15 years ago
|
// TQString getWorkgroup() const;
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Returns path after workgroup
|
||
|
*/
|
||
15 years ago
|
// TQString getServerShareDir() const;
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Return a URL that is suitable for libsmbclient
|
||
|
*/
|
||
15 years ago
|
TQCString toSmbcUrl() const { return m_surl; }
|
||
15 years ago
|
|
||
|
private:
|
||
|
/**
|
||
15 years ago
|
* Change from TQString to TQCString (MS Windows's character encoding)
|
||
15 years ago
|
*/
|
||
15 years ago
|
TQCString fromUnicode( const TQString &_str ) const;
|
||
15 years ago
|
|
||
|
void updateCache();
|
||
15 years ago
|
TQCString m_surl;
|
||
15 years ago
|
|
||
|
/**
|
||
|
* Type of URL
|
||
|
* @see _SMBUrlType
|
||
|
*/
|
||
|
mutable SMBUrlType m_type;
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif
|
||
|
|