Skip to content

Commit

Permalink
Doxygen comment changes and renaming of internal functions
Browse files Browse the repository at this point in the history
git-svn-id: http://hamcrest.googlecode.com/svn/trunk/hamcrest-objectivec@469 2aa0e9f1-8e24-0410-adc4-1b6a3a6e65e2
  • Loading branch information
jon.m.reid committed Oct 14, 2009
1 parent 3691886 commit ffe285e
Show file tree
Hide file tree
Showing 18 changed files with 54 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Source/Core/Core/HCIs.mm
Expand Up @@ -56,7 +56,7 @@ - (void) describeTo:(id<HCDescription>)description

id<HCMatcher> HC_is(id item)
{
return [HCIs is:HC_wrapShortcut(item)];
return [HCIs is:HC_wrapInMatcher(item)];
}

} // extern "C"
2 changes: 1 addition & 1 deletion Source/Core/Core/HCIsNot.mm
Expand Up @@ -56,7 +56,7 @@ - (void) describeTo:(id<HCDescription>)description

id<HCMatcher> HC_isNot(id item)
{
return [HCIsNot isNot:HC_wrapShortcut(item)];
return [HCIsNot isNot:HC_wrapInMatcher(item)];
}

} // extern "C"
10 changes: 9 additions & 1 deletion Source/Core/HCBaseDescription.h
Expand Up @@ -17,6 +17,14 @@
@end


/**
Methods that must be provided by subclasses of HCBaseDescription.
*/
@interface HCBaseDescription (SubclassMustImplement)
- (void) append:(NSString*)string;

/**
Append the string @a str to the description.
*/
- (void) append:(NSString*)str;

@end
1 change: 1 addition & 0 deletions Source/Core/HCBaseDescription.mm
Expand Up @@ -34,6 +34,7 @@ @implementation HCBaseDescription
return self;
}


- (id<HCDescription>) appendValue:(id)value
{
if (value == nil)
Expand Down
6 changes: 6 additions & 0 deletions Source/Core/HCStringDescription.h
Expand Up @@ -27,8 +27,14 @@
*/
+ (NSString*) stringFrom:(id<HCSelfDescribing>)selfDescribing;

/**
Returns an empty description.
*/
+ (HCStringDescription*) stringDescription;

/**
Returns an initialized HCStringDescription object that is empty.
*/
- (id) init;

@end
4 changes: 2 additions & 2 deletions Source/Core/HCStringDescription.mm
Expand Up @@ -51,9 +51,9 @@ - (NSString*) description
}


- (void) append:(NSString*)string
- (void) append:(NSString*)str
{
[accumulator appendString:string];
[accumulator appendString:str];
}

@end
3 changes: 3 additions & 0 deletions Source/Core/Internal/HCCollectMatchers.h
Expand Up @@ -18,6 +18,9 @@
extern "C" {
#endif

/**
Returns an array of matchers from a variable-length comma-separated list terminated by @c nil.
*/
NSMutableArray* HC_collectMatchers(id<HCMatcher> matcher, va_list args);

#ifdef __cplusplus
Expand Down
6 changes: 5 additions & 1 deletion Source/Core/Internal/HCIntegerTypes.h
Expand Up @@ -5,7 +5,11 @@
// Created by: Jon Reid
//

// Define Leopard types for Tiger
/**
\file
Define Leopard integer types for Tiger
*/

#if !defined(OBJC_API_VERSION) || OBJC_API_VERSION < 2

typedef long NSInteger;
Expand Down
7 changes: 6 additions & 1 deletion Source/Core/Internal/HCWrapShortcut.h
Expand Up @@ -12,7 +12,12 @@
extern "C" {
#endif

id<HCMatcher> HC_wrapShortcut(id item);
/**
Returns @a item wrapped (if necessary) in an HCIsEqual matcher.
@a item is returned as-is if it is already an HCMatcher.
*/
id<HCMatcher> HC_wrapInMatcher(id item);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Internal/HCWrapShortcut.mm
Expand Up @@ -15,7 +15,7 @@

extern "C" {

id<HCMatcher> HC_wrapShortcut(id item)
id<HCMatcher> HC_wrapInMatcher(id item)
{
if ([item conformsToProtocol:@protocol(HCMatcher)])
return item;
Expand Down
8 changes: 8 additions & 0 deletions Source/Core/Internal/NSObject_HCSelfDescribingValue.h
Expand Up @@ -11,8 +11,16 @@
@protocol HCDescription;


/**
This category allows any object to satisfy the HCSelfDescribing protocol.
*/
@interface NSObject (HCSelfDescribingValue)

/**
Generates a description of the object.
@param description The description to be appended to.
*/
- (void) describeTo:(id<HCDescription>)description;

@end
2 changes: 1 addition & 1 deletion Source/Library/Collection/HCIsCollectionContaining.mm
Expand Up @@ -75,7 +75,7 @@ - (void) describeTo:(id<HCDescription>)description

id<HCMatcher> HC_hasItem(id item)
{
return [HCIsCollectionContaining isCollectionContaining:HC_wrapShortcut(item)];
return [HCIsCollectionContaining isCollectionContaining:HC_wrapInMatcher(item)];
}


Expand Down
4 changes: 2 additions & 2 deletions Source/Library/Collection/HCIsCollectionOnlyContaining.mm
Expand Up @@ -80,14 +80,14 @@ - (void) describeTo:(id<HCDescription>)description

id<HCMatcher> HC_onlyContains(id item, ...)
{
NSMutableArray* matcherList = [NSMutableArray arrayWithObject:HC_wrapShortcut(item)];
NSMutableArray* matcherList = [NSMutableArray arrayWithObject:HC_wrapInMatcher(item)];

va_list args;
va_start(args, item);
item = va_arg(args, id);
while (item != nil)
{
[matcherList addObject:HC_wrapShortcut(item)];
[matcherList addObject:HC_wrapInMatcher(item)];
item = va_arg(args, id);
}
va_end(args);
Expand Down
4 changes: 2 additions & 2 deletions Source/Library/Collection/HCIsDictionaryContaining.mm
Expand Up @@ -80,8 +80,8 @@ - (void) describeTo:(id<HCDescription>)description

id<HCMatcher> HC_hasEntry(id key, id value)
{
return [HCIsDictionaryContaining isDictionaryContainingKey:HC_wrapShortcut(key)
value:HC_wrapShortcut(value)];
return [HCIsDictionaryContaining isDictionaryContainingKey:HC_wrapInMatcher(key)
value:HC_wrapInMatcher(value)];
}

} // extern "C"
2 changes: 1 addition & 1 deletion Source/Library/Collection/HCIsDictionaryContainingKey.mm
Expand Up @@ -71,7 +71,7 @@ - (void) describeTo:(id<HCDescription>)description

id<HCMatcher> HC_hasKey(id item)
{
return [HCIsDictionaryContainingKey isDictionaryContainingKey:HC_wrapShortcut(item)];
return [HCIsDictionaryContainingKey isDictionaryContainingKey:HC_wrapInMatcher(item)];
}

} // extern "C"
2 changes: 1 addition & 1 deletion Source/Library/Collection/HCIsDictionaryContainingValue.mm
Expand Up @@ -71,7 +71,7 @@ - (void) describeTo:(id<HCDescription>)description

id<HCMatcher> HC_hasValue(id item)
{
return [HCIsDictionaryContainingValue isDictionaryContainingValue:HC_wrapShortcut(item)];
return [HCIsDictionaryContainingValue isDictionaryContainingValue:HC_wrapInMatcher(item)];
}

} // extern "C"
2 changes: 1 addition & 1 deletion Source/Library/Object/HCHasDescription.mm
Expand Up @@ -58,7 +58,7 @@ - (void) describeTo:(id<HCDescription>)description

id<HCMatcher> HC_hasDescription(id item)
{
return [HCHasDescription hasDescription:HC_wrapShortcut(item)];
return [HCHasDescription hasDescription:HC_wrapInMatcher(item)];
}

} // extern "C"
3 changes: 3 additions & 0 deletions Source/Library/Text/HCRequireNonNilString.h
Expand Up @@ -11,6 +11,9 @@

namespace hamcrest {

/**
Throws an NSException if @a string is nil.
*/
inline
void requireNonNilString(NSString* string)
{
Expand Down

0 comments on commit ffe285e

Please sign in to comment.