EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SetFileSystemName, no const pointer?

Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.
#26326
Posted: 09/05/2013 11:08:55
by William Levra-Juillet (Priority Standard support level)
Joined: 09/05/2013
Posts: 49

Hey,
Just curious, why is the parameter to SetFileSystemName() not a const char*?
In the header file, it's declared as SetFileSystemName(LPWSTR FileSystemName);
Shouldn't it be LPCWSTR?

Thx!
#26327
Posted: 09/05/2013 11:11:30
by Eugene Mayevski (EldoS Corp.)

Does the type really matter there?


Sincerely yours
Eugene Mayevski
#26328
Posted: 09/05/2013 11:18:41
by William Levra-Juillet (Priority Standard support level)
Joined: 09/05/2013
Posts: 49

Yeah, kind of, a non const implies the string might be modified inside the function.
Also, it makes it hard when using std::wstring::c_str() that returns a const pointer.

That's tiny details that make a great API :)

If you can confirm that the string is not modified by the function (which I assumed), any chance you can change it to LPCWSTR in a new release?

Thx!
#26329
Posted: 09/05/2013 11:28:11
by Eugene Mayevski (EldoS Corp.)

Yes, we'll change this - lower-level API declares the parameter as const anyway.


Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 664 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!