diff options
author | Olli Savia <ops@iki.fi> | 2008-12-15 09:22:15 +0000 |
---|---|---|
committer | Olli Savia <ops@iki.fi> | 2008-12-15 09:22:15 +0000 |
commit | 71624ca7e8afdcd1e390547b509e0905664940c3 (patch) | |
tree | edfcf7291c6c733837dd627bc23ef38569e73879 | |
parent | 6fdcc224a39537c7644a4c430f9ce54ca3aeb4ba (diff) | |
download | ATCD-71624ca7e8afdcd1e390547b509e0905664940c3.tar.gz |
ChangeLogTag: Mon Dec 15 09:15:54 UTC 2008 Olli Savia <ops@iki.fi>
-rw-r--r-- | ACE/ChangeLog | 11 | ||||
-rw-r--r-- | ACE/ace/ACE.h | 8 | ||||
-rw-r--r-- | ACE/ace/ACE.inl | 9 |
3 files changed, 23 insertions, 5 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 478318b0137..b47fffaa3e9 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,10 @@ +Mon Dec 15 09:15:54 UTC 2008 Olli Savia <ops@iki.fi> + + * ace/ACE.h: + * ace/ACE.inl: + Added wchar_t variant of ACE::isdotdir(). Thanks to Johnny + for pointing this out. + Sat Dec 13 18:25:15 UTC 2008 Ciju John <johnc at ociweb dot com> * bin/tao_other_tests.lst: @@ -16,13 +23,13 @@ Fri Dec 12 13:26:19 UTC 2008 Olli Savia <ops@iki.fi> Fri Dec 12 13:17:43 UTC 2008 Olli Savia <ops@iki.fi> * tests/Dirent_Test.cpp: - Updated to use new isdotdir() funtion. + Updated to use new ACE::isdotdir() function. Fri Dec 12 13:08:58 UTC 2008 Olli Savia <ops@iki.fi> * ace/ACE.h: * ace/ACE.inl: - Added a new function isdotdir() which determines if a specified + Added a new function ACE::isdotdir() which determines if a specified pathname is "dot dir" (ie. "." or ".."). isdotdir() is significantly faster than pair of strcmp() calls. diff --git a/ACE/ace/ACE.h b/ACE/ace/ACE.h index eaa6915433d..38f4233c8eb 100644 --- a/ACE/ace/ACE.h +++ b/ACE/ace/ACE.h @@ -418,6 +418,9 @@ namespace ACE /// @c ACE_OS::malloc to allocate the new string. extern ACE_Export char *strnnew (const char *str, size_t n); + /// Determine if a specified pathname is "dot dir" (ie. "." or ".."). + ACE_NAMESPACE_INLINE_FUNCTION bool isdotdir (const char *s); + #if defined (ACE_HAS_WCHAR) extern ACE_Export const wchar_t *strend (const wchar_t *s); @@ -429,10 +432,9 @@ namespace ACE extern ACE_Export wchar_t *strnnew (const wchar_t *str, size_t n); -#endif /* ACE_HAS_WCHAR */ + ACE_NAMESPACE_INLINE_FUNCTION bool isdotdir (const wchar_t *s); - /// Determine if a specified pathname is "dot dir" (ie. "." or ".."). - ACE_NAMESPACE_INLINE_FUNCTION bool isdotdir (const char *s); +#endif /* ACE_HAS_WCHAR */ /** * On Windows, determines if a specified pathname ends with ".exe" diff --git a/ACE/ace/ACE.inl b/ACE/ace/ACE.inl index 507ec46108e..cb4c0e215c5 100644 --- a/ACE/ace/ACE.inl +++ b/ACE/ace/ACE.inl @@ -291,6 +291,15 @@ ACE::isdotdir (const char *s) ((s[1] == 0) || (s[1] == '.' && s[2] == 0))); } +#if defined (ACE_HAS_WCHAR) +ACE_INLINE bool +ACE::isdotdir (const wchar_t *s) +{ + return (s[0] == ACE_TEXT ('.') && + ((s[1] == 0) || (s[1] == ACE_TEXT ('.') && s[2] == 0))); +} +#endif /* ACE_HAS_WCHAR */ + ACE_INLINE void ACE::unique_name (const void *object, ACE_TCHAR *name, |