<commit_before>/* WCType.h: An abstract class for objc/java type conversion -*-objc-*-

   Copyright (C) 2000 Free Software Foundation, Inc.

   Author:  <NAME> <<EMAIL>>
   Date: August 2000
   
   This file is part of JIGS, the GNUstep Java Interface.
   
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
   
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */

/*
 * WCType encapsulates a type that can be converted from objective-C to java
 * and rules to convert it.
 *
 * WCTypes are shared - only a single shared WCType object representing a
 * string type is created, for example.
 *
 * WCType is an abstract class.  Concrete subclasses are created as needed
 * by the WCTypeLoader class.
 *
 */


#ifndef __WCType_h_GNUSTEP_WrapCreator_INCLUDE
#define __WCType_h_GNUSTEP_WrapCreator_INCLUDE

#include <Foundation/Foundation.h>

@interface WCType : NSObject
{
  NSString *objcType;   /* @"String" */
}

/*
 * Return the type for objective-C type 'name'. 
 * Call WCTypeLoader if needed to create a new WCType.
 *
 */
+ (WCType *) sharedTypeWithObjcType: (NSString *)name;

/*
 * The same, but only return the type is it was already created; 
 * otherwise return nil without calling the WCTypeLoader.  Mainly 
 * provided because it is handy in initWithObjcType:.
 *
 */
+ (WCType *) existingSharedTypeWithObjcType: (NSString *)name;

- (id) initWithObjcType: (NSString *)type;

- (NSString *) javaType;

/* Return 'nil' if it couldn't be determined and has to be looked up 
   at run-time */
- (NSString *) javaArgumentType;

- (NSString *) objcType;

- (NSString *) jniType;

- (BOOL) isVoidType;

/*
 * Eg: if StringType is the shared Type for strings, 
 * [StringType codeToConvertToObjc: @"var1" givingResult: @"var0"]; will output: 
 * @"var1 = GSJNI_NSStringFromJString (env, var0);"
 *
 */
- (NSString *) codeToConvertToObjc: (NSString *)jniArgument
		      givingResult: (NSString *)objcResult;

/*
 * Eg: if StringType is the shared Type for strings, 
 * [StringType codeToConvertToJava: @"var1" givingResult: @"var0"]; will output: 
 * @"var1 = GSJNI_JStringFromNSString (env, var0);"
 *
 */
- (NSString *) codeToConvertToJava: (NSString *)objcArgument
		      givingResult: (NSString *)jniResult;
@end

#endif /* __WCType_h_GNUSTEP_WrapCreator_INCLUDE */<commit_msg>Updated comments to the new string morphing functions<commit_after>/* WCType.h: An abstract class for objc/java type conversion -*-objc-*-

   Copyright (C) 2000 Free Software Foundation, Inc.

   Author:  <NAME> <<EMAIL>>
   Date: August 2000
   
   This file is part of JIGS, the GNUstep Java Interface.
   
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
   
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */

/*
 * WCType encapsulates a type that can be converted from objective-C to java
 * and rules to convert it.
 *
 * WCTypes are shared - only a single shared WCType object representing a
 * string type is created, for example.
 *
 * WCType is an abstract class.  Concrete subclasses are created as needed
 * by the WCTypeLoader class.
 *
 */


#ifndef __WCType_h_GNUSTEP_WrapCreator_INCLUDE
#define __WCType_h_GNUSTEP_WrapCreator_INCLUDE

#include <Foundation/Foundation.h>

@interface WCType : NSObject
{
  NSString *objcType;   /* @"String" */
}

/*
 * Return the type for objective-C type 'name'. 
 * Call WCTypeLoader if needed to create a new WCType.
 *
 */
+ (WCType *) sharedTypeWithObjcType: (NSString *)name;

/*
 * The same, but only return the type is it was already created; 
 * otherwise return nil without calling the WCTypeLoader.  Mainly 
 * provided because it is handy in initWithObjcType:.
 *
 */
+ (WCType *) existingSharedTypeWithObjcType: (NSString *)name;

- (id) initWithObjcType: (NSString *)type;

- (NSString *) javaType;

/* Return 'nil' if it couldn't be determined and has to be looked up 
   at run-time */
- (NSString *) javaArgumentType;

- (NSString *) objcType;

- (NSString *) jniType;

- (BOOL) isVoidType;

/*
 * Eg: if StringType is the shared Type for strings, 
 * [StringType codeToConvertToObjc: @"var1" givingResult: @"var0"]; will output: 
 * @"var1 = JIGSNSStringFromJstring (env, var0);"
 *
 */
- (NSString *) codeToConvertToObjc: (NSString *)jniArgument
		      givingResult: (NSString *)objcResult;

/*
 * Eg: if StringType is the shared Type for strings, 
 * [StringType codeToConvertToJava: @"var1" givingResult: @"var0"]; will output: 
 * @"var1 = JIGSJstringFromNSString (env, var0);"
 *
 */
- (NSString *) codeToConvertToJava: (NSString *)objcArgument
		      givingResult: (NSString *)jniResult;
@end

#endif /* __WCType_h_GNUSTEP_WrapCreator_INCLUDE */
{'fraction_non_alphanumeric': 0.09137931034482759, 'fraction_numerical': 0.008620689655172414, 'mean_word_length': 3.7784184514003294, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3712599', 'n_tokens_mistral': 1823, 'n_tokens_neox': 1716, 'n_words': 691}