|
Does anyone know if there are any c++ examples of parsing date/time from rfc822/1123 email message headers on the net?
(I've done much hunting for this but can't seem to find an actual snippet or source and I don't want to re-invent the wheel)
|
|
|
|
|
all u need is a regular expression engine or even a simple tokenizer class will do the job do u have either of those?
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
No I don't, but I know that's how it's done in the perl world etc.
I was hoping to avoid all that and find a function in straight c or c++; the problem is that there are variants of the way that date is presented according to the docs I've been reading and it's not uncommon for an algorithm to handle that to have some "finagling" built into it, so rather than re-inventing the wheel...
|
|
|
|
|
>> No I don't
u don't have a simple string tokenizer class? how the heck do you get anything done?
>> so rather than re-inventing the wheel...
just say i said it was ok, this one time!
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
Search for getdate.y. It's an RFC compliant parser written in Yacc. Generate C-code by running bison on it.
Gisle V.
"If you feel paranoid it doesn't mean they're not after you!" -- Woody Allen
|
|
|
|
|
Looking for your opinion on what is the easiest XML class that supports commenting? ie: <example help="a lot">
Thanks
Darroll
Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity.
- General George S. Patton
|
|
|
|
|
|
Ok here's the code
hdrop = (HDROP) ::GlobalLock ( hg );
if ( NULL == hdrop )
{
::GlobalUnlock ( hg );
return;
}
uNumFiles = ::DragQueryFile ( hdrop, -1, NULL, 0 );
for ( UINT uFile = 0; uFile < uNumFiles; uFile++ )
{
// Get the next filename from the HDROP info.
if ( DragQueryFile ( hdrop, uFile, szNextFile, MAX_PATH ) > 0 )
{
// get the orginal filename and determine if the the extension is upper case or
// lowercase.
origfile = szNextFile;
origfile.Delete(0,(origfile.GetLength() - 4));
BOOL isUpper = ::isupper(origfile[1]);
// Now do the rest.
if ( file.Open( szNextFile, CFile::modeRead) ){
CFileFind fileFind;
if ( fileFind.FindFile ( (path + _T("\\") + file.GetFileTitle() ),0) ){
CString temp = file.GetFileTitle();
makes sense right? get access to the clip board, get the file list from the clip board and loop through the file list, getting the file. My problem is that the file.Open function returns a file name that is all Capital letters when getting the information from a media drive (read CDROM). So if a file is lowercase it the file.Open will automatically convert the filename to uppercase.
This is unacceptable becuase now the file that I copy over is no longer the same file
Any ideas
Dan Willis
|
|
|
|
|
Filenames are not case-sensitive in Windows, so if you're relying on a particular case, then your code is incorrect.
But to answer your question, the filename is all uppercase because that's how ISO9660 stores names (it has a limited set of allowable characters). It would be the same if the source partition were FAT16.
--Mike--
The Internet is a place where absolutely nothing happens.
-- Strong Bad
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Mike,
Thanks for the prompt reply. That makes sense. My problem is that people are complaining that when they copy stuff from the CDROM to somewhere else, the filename changes from say lowercase to upper case. Unfortuately I have to come up with a solution. Do you have any suggestions?
I'm not dependent on the "case" of the file name, but the inconsistancy is getting me in trouble
Thanks alot. Starting to make sense now.
Dan Willis
|
|
|
|
|
Could you get the drive letter from the file name and then query the drive type (GetDriveType)?
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Yes, absolutely. But I already have the drive letter and information in hand except if its a media device (easy to get though).
As Mike said, it's the way the character information is being stored, so when I grab the file, it kicks back an all uppercase filename. ugh. not sure how to deal with it.
Dan Willis
|
|
|
|
|
>> not sure how to deal with it
change the interface to make the user supply the target filename using a SaveAs Dialog, u know the same way IE does when you download a file?
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
is this possible? i see nothing in the MSDN about it, there's no "owner-drawn" style checkbox on the scroll bar property page, and i see no articles here or on codeguru about it.
i want a sexy little scroll bar..., not the boring old everyday ones.
-c
Be very, very careful what you put into that head, because you will never, ever get it out. --Thomas Cardinal Wolsey
|
|
|
|
|
Well I'm sure I've seen OD scroll bars, but where... Have you looked on CodeGuru. Doesn't the WinXP Theme stuff let you control the look of any and every control. I don't know whether GUIgui at http://www.nopcode.com[^] mucks with scroll bars, but it is worth a look.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
I have seen them, but I am not sure if they were ownerdrawn scrollbars or custom controls. If I were to try this, I would take a look at the GetScrollBarInfo() (SDK or MFC links) function, it looks promising as it returns the scrollbar's coordinates, thumb size and position, and the state of the various scrollbar components. Maybe call this function in your scrollbar's WM_PAINT handler.
HTH
CPUA 0x5041
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
It's not horrible to implement your own scroll bar. Unfortunately, the example I have belongs to my employer .
Software Zen: delete this;
|
|
|
|
|
Why the GetBuffer?
str2.Format(_T("item %d: %s\r\n"), i, str.GetBuffer(0));
afxDump << str2;
Looks like just a str would be enough instead of str.GetBuffer? The (0) is also puzzling me.
Thanks
Appreciate your help,
ns
|
|
|
|
|
%s wants a const char * (a LPCSTR , in Windows lingo), so the following should suffice:
str2.Format(_T("item %d: %s\r\n"), i, (LPCTSTR)str);
GetBuffer is IMHO overkill for two reasons:- It returns a
char * when just a const char * is needed. - It requires a later call to
ReleaseBuffer , which is prone to error (for lack of care by the programmer, or in the presence of exceptions).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I totally agree with Joaquin. I see GetBuffer abused all over the place, even by Microsoft people.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
|
Actually, you can just use str in this case, since CString includes a builtin LPCTSTR conversion operator. The only time you need GetBuffer is if you are intending to modify the string directly through a character pointer. Also, any time you use GetBuffer , you should call ReleaseBuffer .
Software Zen: delete this;
|
|
|
|
|
I have a bitmap that looks like a form. How can I print
that through visual c++ so that the output looks clear?
I can make it print the bitmap and it looks pretty good,
but the text is just alittle fuzzy. Any ideas on how to
print a crisp, clear bitmap?
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
how are you printing it now?
Be very, very careful what you put into that head, because you will never, ever get it out. --Thomas Cardinal Wolsey
|
|
|
|
|
Hi,
I have a worker thread that calls the socket api's ::accept() function, which blocks until a client machine tries to connect to my application. How do you cancel the block? Say you want to shut down the application... Is there any timeout associated with ::accept()? I couldn't find any...
Thanks in advance!
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|