2004-05-15 12:33 AM - last edited on 2022-12-13 09:56 PM by Daniel Kassai
2004-05-15 08:34 AM
TomWaltz wrote:I think it is a documentation mistake. I dont see the SourceNotFound error code in the FileSystem.
How do I get a pre-defined error value from the FileSystem class scope to work in mine?
2004-05-15 11:26 AM
TomWaltz wrote:Are you looking for IO::Folder::SourceNotFound?
As a result, all of my error checking statements, i.e.: if (err == SourceNotFound) return an error that "SourceNotFound" is an invalid identifier".
I've tried fileSystem.SourceNotFound and fileSystem::SourceNotFound, with no luck.
2004-05-15 12:33 PM
2004-05-15 01:32 PM
2004-05-15 09:46 PM
virtual GSErrCode Copy (const Name& from, const Name& to); virtual GSErrCode Copy (const Name& from, Folder& target, const Name& to); virtual GSErrCode Copy (const Name& from, Folder& target, const Name& to) const;right at the top, maybe with a one line summary, hyperlinked. (I'm not sure what I think about the subtle difference between the last two variants, or the fact that the last one does a runtime check that 'from' and 'target' are different - yet there is no unique/defined error return value documented for that event.)
2004-05-17 04:17 PM
Oleg wrote:I think the difficulty exists primarily for us because GS is too stretched to fill in the blanks in the documentation - not a criticism, just a fact of life for a development team.
Hmm.., It is "interesting" class design, to return an error code defined in the Folder class from a FileSystem member function. A puzzle.
2004-05-17 05:43 PM
2004-05-17 06:09 PM
TomWaltz wrote:You can call anything you like, but the support isn't in the ArchiCAD API. You need to use the Mac OS itself.
Maybe the question I SHOULD have asked is this:
Can Archicad call an outside shell script? (on a Mac)
2004-05-17 06:46 PM
Ralph wrote:I am not against more meaning error codes of course.
For example, if you give a 'FileSystem' object a Location 'object' that refers to a 'Folder' object, and the folder object 'knows' that it isn't physically represented anywhere, it returns the message 'SourceNotFound'. Or if you are overwriting an existing physical folder, it would return 'TargetExists'. The error conditions have more meaning because they are defined in a narrower context. IMHO this is better than a single huge list of error codes.
class FileSystem { ... enum { ... SourceNotFound=Folder::SourceNotFound ... }; ... };PS: