Links
dtSearch Text Retrieval Engine Programmer's Reference 7.70
DFilename Class
Classes | Legend | Members | Methods | Operators | = Operator | DFilename Constructor | Send Feedback

Filename class for use in the dtSearch C++ Support classes and sample code.

Class Hierarchy
class DFilename : public DString;
File

dstring.h

Remarks

Filenames are stored as UTF-8 in a string buffer based on DString. DFilename adds no data members and just provides functions to manipulate paths in a string. The path manipulation functions handle Unix-style and Windows-style paths.

Group
Methods
Method 
Description 
Return the text in the DString as a COM BSTR. 
Convert encoding from Ansi to Utf8 
Append text to a string 
Append a single character 
Append without null-termination for faster building of strings 
Append text, HTML-encoding it. 
Append a string without null-termination for faster building of strings 
Store Unicode text, converting it to UTF-8, appending to an existing string 
Append text, URL-encoding it 
Append text, URL-encoding it but preserving filename characters 
Convert only A-Z to lower case 
Convert only a-z to upper case 
copy by length, potentially including null characters 
This is the overview for the commaNum method overload. 
This is the overview for the contains method overload. 
copy 
Copy another string 
Convert UTF-8 text to Unicode 
This is the overview for the DString constructor overload. 
Extend the string buffer to a minimum length 
find 
This is the overview for the find method overload. 
Find first instance of any of the characters in a list 
First character in the string, or null if the string is empty 
Get character at a specified position in the string 
Read the contents of a file into a text buffer (TCHAR filename) 
Read the contents of a file into a text buffer, automatically converting UCS-16 to UTF-8 
Read the contents of a file into a text buffer, automatically converting UCS-16 to UTF-8 (UTF-8 filename) 
Get the contents of a string returned from the dtSearch Engine as a dtsStringHandle 
Read the contents of a file into a text buffer (UTF8 filename) 
Returns the length of the string 
Get the size of the buffer used to store the string 
hex 
This is the overview for the hex method overload. 
Append an integer formatted as a hexadecimal number with zero-padding 
HTML-encode the contents of the string 
Returns true if substr occurs in this string (case-insensitive) 
Find a string, with case-insensitive matching 
This is the overview for the insert method overload. 
Replace one string with another, with case-insensitive matching 
Returns true if the string does not contain any non-whitespace characters 
last 
Last character in the string, or null if the string is empty 
Null-terminate the string 
Fill string with a character, inserting the character in the front of the string 
Fill string with a character 
Remove a range of characters from a string 
Remove all instances of a character 
This is the overview for the replace method overload. 
This is the overview for the rfind method overload. 
Remove leading white space 
Remove leading white space, checking for UTF-8 encoded hard spaces 
Remove trailing white space 
Remove trailing white space, checking for UTF-8 encoded hard spaces 
Get an environment variable and return its value 
set 
This is the overview for the set method overload. 
Set text contents 
Extend will throw std::bad_alloc if memory is insufficient 
Store Ansi text, converting it to UTF-8 
Store either ANSI or Unicode as UTF8, depending on type of TCHAR 
This is the overview for the storeUnicodeAsAnsi method overload. 
This is the overview for the storeUnicodeAsUtf8 method overload. 
str 
Returns a pointer to the internal buffer holding the string 
Extract a substring from a string 
Convert to lower case 
Convert to upper case 
Replace one set of characters with another 
trim 
Remove all leading and trailing whitespace 
Truncate a string to a specified length 
Truncate string at offset of character (not including the character) 
Truncate string at offset of substring (not including the substring) 
Try to extend the string buffer to a minimum length, and return false if unsuccessful 
This is the overview for the urlDecode method overload. 
Decode URL-encoded characters and convert to UTF-8 
URL-encode the contents of the string 
ustr 
Returns an unsigned character pointer to the internal buffer holding the string 
Convert encoding from Utf8 to Ansi 
Write contents of the string to a file, using a TCHAR filename 
Write contents of the string to a file, using a UTF-8 filename 
DFilename Class
Method 
Description 
Append a filename to the path in the string, adding a slash if necessary 
This is the overview for the DFilename constructor overload. 
Get current working directory 
Get the extension from the filename in the path 
Get the folder name from a path 
Extract the path portion of a URL 
Get the slash type for a filename (backslash or slash). 
Get the filename from the string (for example, "sample.doc" if the string is "/tmp/subfolder/sample.doc") 
Returns true if the string is a mapped drive 
Returns true if the extension matches the extension of the filename 
Returns true if the string is a UNC path 
Returns true if the string is a URL 
Convert the path to an absolute path 
Convert the path to a relative path. 
Generate a temporary filename 
Remove the extension 
Remove the folder name from the path 
Remove the last element in the filename 
Replace the extension in the filename 
Change the slash type in the path (for example, from backslash to slash) 
Remove redundant path elements (example, "/tmp/subfolder/../otherfolder/sample.doc would become "/tmp/otherfolder/sample.doc 
Split the path into a folder name and filename 
Operators
Operator 
Description 
!= 
This is the overview for the != operator overload. 
+= 
This is the overview for the += operator overload. 
<< 
This is the overview for the << operator overload. 
= 
This is the overview for the = operator overload. 
== 
This is the overview for the == operator overload. 
Returns a pointer to the internal buffer holding the string 
DFilename Class
Operator 
Description 
= 
This is the overview for the = operator overload. 
Legend
 
Operator 
 
Method 
 
virtual 
Links
You are here: C++ Support Classes > dtSearch Namespace > Classes > DFilename Class
Copyright (c) 1995-2012 dtSearch Corp. All rights reserved.