clang API Documentation

Public Types | Public Member Functions | Static Public Attributes
clang::NSAPI Class Reference

#include <NSAPI.h>

Collaboration diagram for clang::NSAPI:
Collaboration graph
[legend]

List of all members.

Public Types

enum  NSClassIdKindKind {
  ClassId_NSObject, ClassId_NSString, ClassId_NSArray, ClassId_NSMutableArray,
  ClassId_NSDictionary, ClassId_NSMutableDictionary, ClassId_NSNumber
}
enum  NSStringMethodKind {
  NSStr_stringWithString, NSStr_stringWithUTF8String, NSStr_stringWithCStringEncoding, NSStr_stringWithCString,
  NSStr_initWithString, NSStr_initWithUTF8String
}
enum  NSArrayMethodKind {
  NSArr_array, NSArr_arrayWithArray, NSArr_arrayWithObject, NSArr_arrayWithObjects,
  NSArr_arrayWithObjectsCount, NSArr_initWithArray, NSArr_initWithObjects, NSArr_objectAtIndex,
  NSMutableArr_replaceObjectAtIndex
}
 Enumerates the NSArray methods used to generate literals. More...
enum  NSDictionaryMethodKind {
  NSDict_dictionary, NSDict_dictionaryWithDictionary, NSDict_dictionaryWithObjectForKey, NSDict_dictionaryWithObjectsForKeys,
  NSDict_dictionaryWithObjectsForKeysCount, NSDict_dictionaryWithObjectsAndKeys, NSDict_initWithDictionary, NSDict_initWithObjectsAndKeys,
  NSDict_initWithObjectsForKeys, NSDict_objectForKey, NSMutableDict_setObjectForKey
}
 Enumerates the NSDictionary methods used to generate literals. More...
enum  NSNumberLiteralMethodKind {
  NSNumberWithChar, NSNumberWithUnsignedChar, NSNumberWithShort, NSNumberWithUnsignedShort,
  NSNumberWithInt, NSNumberWithUnsignedInt, NSNumberWithLong, NSNumberWithUnsignedLong,
  NSNumberWithLongLong, NSNumberWithUnsignedLongLong, NSNumberWithFloat, NSNumberWithDouble,
  NSNumberWithBool, NSNumberWithInteger, NSNumberWithUnsignedInteger
}
 Enumerates the NSNumber methods used to generate literals. More...

Public Member Functions

 NSAPI (ASTContext &Ctx)
ASTContextgetASTContext () const
IdentifierInfogetNSClassId (NSClassIdKindKind K) const
Selector getNSStringSelector (NSStringMethodKind MK) const
 The Objective-C NSString selectors.
Optional< NSStringMethodKindgetNSStringMethodKind (Selector Sel) const
 Return NSStringMethodKind if.
bool isNSUTF8StringEncodingConstant (const Expr *E) const
 Returns true if the expression.
bool isNSASCIIStringEncodingConstant (const Expr *E) const
 Returns true if the expression.
Selector getNSArraySelector (NSArrayMethodKind MK) const
 The Objective-C NSArray selectors.
Optional< NSArrayMethodKindgetNSArrayMethodKind (Selector Sel)
 Return NSArrayMethodKind if Sel is such a selector.
Selector getNSDictionarySelector (NSDictionaryMethodKind MK) const
 The Objective-C NSDictionary selectors.
Optional< NSDictionaryMethodKindgetNSDictionaryMethodKind (Selector Sel)
 Return NSDictionaryMethodKind if Sel is such a selector.
Selector getObjectForKeyedSubscriptSelector () const
 Returns selector for "objectForKeyedSubscript:".
Selector getObjectAtIndexedSubscriptSelector () const
 Returns selector for "objectAtIndexedSubscript:".
Selector getSetObjectForKeyedSubscriptSelector () const
 Returns selector for "setObject:forKeyedSubscript".
Selector getSetObjectAtIndexedSubscriptSelector () const
 Returns selector for "setObject:atIndexedSubscript".
Selector getIsEqualSelector () const
 Returns selector for "isEqual:".
Selector getNSNumberLiteralSelector (NSNumberLiteralMethodKind MK, bool Instance) const
 The Objective-C NSNumber selectors used to create NSNumber literals.
bool isNSNumberLiteralSelector (NSNumberLiteralMethodKind MK, Selector Sel) const
Optional
< NSNumberLiteralMethodKind
getNSNumberLiteralMethodKind (Selector Sel) const
 Return NSNumberLiteralMethodKind if Sel is such a selector.
Optional
< NSNumberLiteralMethodKind
getNSNumberFactoryMethodKind (QualType T) const
 Determine the appropriate NSNumber factory method kind for a literal of the given type.
bool isObjCBOOLType (QualType T) const
 Returns true if.
bool isObjCNSIntegerType (QualType T) const
 Returns true if.
bool isObjCNSUIntegerType (QualType T) const
 Returns true if.
StringRef GetNSIntegralKind (QualType T) const
 Returns one of NSIntegral typedef names if.

Static Public Attributes

static const unsigned NumClassIds = 7
static const unsigned NumNSStringMethods = 5
static const unsigned NumNSArrayMethods = 9
static const unsigned NumNSDictionaryMethods = 12
static const unsigned NumNSNumberLiteralMethods = 15

Detailed Description

Definition at line 23 of file NSAPI.h.


Member Enumeration Documentation

Enumerates the NSArray methods used to generate literals.

Enumerator:
NSArr_array 
NSArr_arrayWithArray 
NSArr_arrayWithObject 
NSArr_arrayWithObjects 
NSArr_arrayWithObjectsCount 
NSArr_initWithArray 
NSArr_initWithObjects 
NSArr_objectAtIndex 
NSMutableArr_replaceObjectAtIndex 

Definition at line 71 of file NSAPI.h.

Enumerator:
ClassId_NSObject 
ClassId_NSString 
ClassId_NSArray 
ClassId_NSMutableArray 
ClassId_NSDictionary 
ClassId_NSMutableDictionary 
ClassId_NSNumber 

Definition at line 29 of file NSAPI.h.

Enumerates the NSDictionary methods used to generate literals.

Enumerator:
NSDict_dictionary 
NSDict_dictionaryWithDictionary 
NSDict_dictionaryWithObjectForKey 
NSDict_dictionaryWithObjectsForKeys 
NSDict_dictionaryWithObjectsForKeysCount 
NSDict_dictionaryWithObjectsAndKeys 
NSDict_initWithDictionary 
NSDict_initWithObjectsAndKeys 
NSDict_initWithObjectsForKeys 
NSDict_objectForKey 
NSMutableDict_setObjectForKey 

Definition at line 91 of file NSAPI.h.

Enumerates the NSNumber methods used to generate literals.

Enumerator:
NSNumberWithChar 
NSNumberWithUnsignedChar 
NSNumberWithShort 
NSNumberWithUnsignedShort 
NSNumberWithInt 
NSNumberWithUnsignedInt 
NSNumberWithLong 
NSNumberWithUnsignedLong 
NSNumberWithLongLong 
NSNumberWithUnsignedLongLong 
NSNumberWithFloat 
NSNumberWithDouble 
NSNumberWithBool 
NSNumberWithInteger 
NSNumberWithUnsignedInteger 

Definition at line 142 of file NSAPI.h.

Enumerator:
NSStr_stringWithString 
NSStr_stringWithUTF8String 
NSStr_stringWithCStringEncoding 
NSStr_stringWithCString 
NSStr_initWithString 
NSStr_initWithUTF8String 

Definition at line 40 of file NSAPI.h.


Constructor & Destructor Documentation

NSAPI::NSAPI ( ASTContext Ctx) [explicit]

Definition at line 17 of file NSAPI.cpp.


Member Function Documentation

Returns selector for "isEqual:".

Definition at line 137 of file NSAPI.h.

Return NSArrayMethodKind if Sel is such a selector.

Definition at line 134 of file NSAPI.cpp.

References getNSArraySelector(), and NumNSArrayMethods.

Return NSDictionaryMethodKind if Sel is such a selector.

Definition at line 220 of file NSAPI.cpp.

References getNSDictionarySelector(), and NumNSDictionaryMethods.

StringRef NSAPI::GetNSIntegralKind ( QualType  T) const

Returns one of NSIntegral typedef names if.

Parameters:
Tis a typedef of that name in objective-c.

Definition at line 387 of file NSAPI.cpp.

References clang::Type::getAs(), clang::ASTContext::getLangOpts(), and clang::QualType::isNull().

Return NSNumberLiteralMethodKind if Sel is such a selector.

Definition at line 283 of file NSAPI.cpp.

References isNSNumberLiteralSelector(), and NumNSNumberLiteralMethods.

Referenced by rewriteToNumberLiteral(), and rewriteToNumericBoxedExpression().

The Objective-C NSNumber selectors used to create NSNumber literals.

Parameters:
Instanceif true it will return the selector for the init* method otherwise it will return the selector for the number* method.

Definition at line 230 of file NSAPI.cpp.

References clang::IdentifierTable::get(), clang::SelectorTable::getUnarySelector(), clang::ASTContext::Idents, NumNSNumberLiteralMethods, and clang::ASTContext::Selectors.

Referenced by isNSNumberLiteralSelector().

Return NSStringMethodKind if.

Parameters:
Selis such a selector.

Definition at line 76 of file NSAPI.cpp.

References getNSStringSelector(), and NumNSStringMethods.

Returns selector for "objectAtIndexedSubscript:".

Definition at line 119 of file NSAPI.h.

Referenced by rewriteToArraySubscriptGet().

Returns selector for "objectForKeyedSubscript:".

Definition at line 113 of file NSAPI.h.

Referenced by rewriteToDictionarySubscriptGet().

Returns selector for "setObject:atIndexedSubscript".

Definition at line 131 of file NSAPI.h.

Referenced by rewriteToArraySubscriptSet().

Returns selector for "setObject:forKeyedSubscript".

Definition at line 125 of file NSAPI.h.

Referenced by rewriteToDictionarySubscriptSet().

Returns true if the expression.

Parameters:
Eis a reference of "NSASCIIStringEncoding" enum constant.

Definition at line 66 of file NSAPI.h.

Referenced by rewriteToStringBoxedExpression().

Returns true if the expression.

Parameters:
Eis a reference of "NSUTF8StringEncoding" enum constant.

Definition at line 60 of file NSAPI.h.

Referenced by rewriteToStringBoxedExpression().

Returns true if.

Parameters:
Tis a typedef of "BOOL" in objective-c.

Definition at line 375 of file NSAPI.cpp.

Referenced by getNSNumberFactoryMethodKind().

Returns true if.

Parameters:
Tis a typedef of "NSInteger" in objective-c.

Definition at line 379 of file NSAPI.cpp.

Referenced by getNSNumberFactoryMethodKind().

Returns true if.

Parameters:
Tis a typedef of "NSUInteger" in objective-c.

Definition at line 383 of file NSAPI.cpp.

Referenced by getNSNumberFactoryMethodKind().


Member Data Documentation

const unsigned clang::NSAPI::NumClassIds = 7 [static]

Definition at line 38 of file NSAPI.h.

Referenced by getNSClassId().

Definition at line 82 of file NSAPI.h.

Referenced by getNSArrayMethodKind().

Definition at line 104 of file NSAPI.h.

Referenced by getNSDictionaryMethodKind().

Definition at line 48 of file NSAPI.h.

Referenced by getNSStringMethodKind().


The documentation for this class was generated from the following files: