History log of /haiku/src/kits/storage/Path.cpp
Revision Date Author Comments
# 65413546 15-Jan-2020 Kyle Ambroff-Kao <kyle@ambroffkao.com>

support/BPath: Flatten should work on empty BPath

BPath::Flatten() on an empty path returns B_OK in BeOS R5, just
writing an empty entry_ref to the povided buffer. The Haiku
implementation has some additional validation that causes B_NO_INIT to
be returned instead.

This patch attempts to recreate the same behavior of BeOS in this
situation.

* Don't check for initialization in BPath::Flatten(). Instead,
just write an empty entry_ref to the provided buffer if the BPath is
empty.
* Fix estimation of expected size when testing the return value of
BPath::FlattenedSize().
* Clean up warning by removing unecessary forward-declaration of
CppUnit::Test.

Change-Id: I88880cbb298bdcb594c9c8fef48314165c49e9e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2115
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>


# f1271b64 19-Nov-2019 Axel Dörfler <axeld@pinc-software.de>

BPath: Removed superfluous term


# a30a4a41 18-Jun-2014 John Scipione <jscipione@gmail.com>

Style fixes to Storage Kit classes.

No functional changes intended.

* Some variable renaming for clarity and consistency.
* Pointer style fixes.
* Added private method documentation back to cpp files for some methods.


# 4c064a84 08-Feb-2013 John Scipione <jscipione@gmail.com>

Move documentation from Path.cpp to Path.dox

And clean it up a bit. Kept brief description in source.
* Also added Axel to authors in Path.dox and Path.cpp because his name
appears in git blame as working on the docs and code for the file.
I hope he doesn't mind.


# 9e42a44c 04-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Added BPath::IsAbsolute() method.


# 49fb9a2e 18-May-2009 Axel Dörfler <axeld@pinc-software.de>

* Flatten() would create an invalid entry ref if the path did not exist, or the
path was not yet initialized. It will now fail instead.
* Got rid of EBadInput - _MustNormalize() can now return an error code instead.
* Style cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30787 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6eb09230 01-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Resolve further warnings on GCC4.
* Enable -Werror on GCC4 builds as well (limited to the same selected targets).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29118 a95241bf-73f2-0310-859d-f6bbb57e9c96


# db10640d 28-Aug-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

Got rid of the Storage Kit's kernel abstraction layer, which was
unfortunately quite slow and made some things more complicated than they
needed to be.
Implemented a few missing things (e.g. BSymLink and node locking).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8694 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 98833b15 11-Jun-2003 haydentech <haydentech@nowhere.fake>

Cleaned-up the std namespace support


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3475 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a0a3f269 03-Jun-2003 haydentech <haydentech@nowhere.fake>

Namespace- and gcc3-related fixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3405 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9a17c3cf 23-Sep-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Dealt with the *_LENGTH+1 issue: Removed all "+1"s in buffer allocations and adjusted checks etc.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1131 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 09d84e61 12-Aug-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

+ Changed StorageKit namespace to BPrivate::Storage
+ Changed Sniffer namespace to BPrivate::Storage::Sniffer


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@714 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a38012 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a30a4a41f948ebb03b95dab065a27a584ac0c97a 18-Jun-2014 John Scipione <jscipione@gmail.com>

Style fixes to Storage Kit classes.

No functional changes intended.

* Some variable renaming for clarity and consistency.
* Pointer style fixes.
* Added private method documentation back to cpp files for some methods.


# 4c064a84514683bd3d11442e26b5e8d2fbf784a6 08-Feb-2013 John Scipione <jscipione@gmail.com>

Move documentation from Path.cpp to Path.dox

And clean it up a bit. Kept brief description in source.
* Also added Axel to authors in Path.dox and Path.cpp because his name
appears in git blame as working on the docs and code for the file.
I hope he doesn't mind.


# 9e42a44cad6e56c2a04b9ee1b76446fdd2916a62 04-Nov-2012 Axel Dörfler <axeld@pinc-software.de>

Added BPath::IsAbsolute() method.


# 49fb9a2eabaa0a674c5542e8155471ecb086a05c 18-May-2009 Axel Dörfler <axeld@pinc-software.de>

* Flatten() would create an invalid entry ref if the path did not exist, or the
path was not yet initialized. It will now fail instead.
* Got rid of EBadInput - _MustNormalize() can now return an error code instead.
* Style cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30787 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6eb09230bae52bcdf045e1f1920b67205c29adc8 01-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Resolve further warnings on GCC4.
* Enable -Werror on GCC4 builds as well (limited to the same selected targets).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29118 a95241bf-73f2-0310-859d-f6bbb57e9c96


# db10640de90f7f9519ba2da9577b7c1af3c64f6b 28-Aug-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

Got rid of the Storage Kit's kernel abstraction layer, which was
unfortunately quite slow and made some things more complicated than they
needed to be.
Implemented a few missing things (e.g. BSymLink and node locking).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8694 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 98833b15bf4967b0b12fda60065cda7ac83e091d 11-Jun-2003 haydentech <haydentech@nowhere.fake>

Cleaned-up the std namespace support


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3475 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a0a3f269a4eae19d6fdbffdb581e888219988160 03-Jun-2003 haydentech <haydentech@nowhere.fake>

Namespace- and gcc3-related fixes


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3405 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9a17c3cfac5f2463b41b3f233975a2904ef10135 23-Sep-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Dealt with the *_LENGTH+1 issue: Removed all "+1"s in buffer allocations and adjusted checks etc.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1131 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 09d84e61b6c2629d253dce1e7d7e944943d3e40e 12-Aug-2002 Tyler Dauwalder <tylerdauwalder@nowhere.fake>

+ Changed StorageKit namespace to BPrivate::Storage
+ Changed Sniffer namespace to BPrivate::Storage::Sniffer


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@714 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a380120846174213ccce9c4aab0dda17c72083 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96