Extern Type of the Linked list type of CURL

Introduced properties

fun append(key: String)

curl :: CURLSList :: append

Append an element in the linked list
fun destroy

curl :: CURLSList :: destroy

Release allocated memory
fun is_init: Bool

curl :: CURLSList :: is_init

Check for initialization
fun to_a: Array[String]

curl :: CURLSList :: to_a

Convert current low level List to an Array[String] object
init with_str(s: String): CURLSList

curl :: CURLSList :: with_str

Constructor allow us to get list instancied by appending an element inside.

Redefined properties

redef type SELF: CURLSList

curl $ CURLSList :: SELF

Type of this instance, automatically specialized in every class

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
fun address_is_null: Bool

core :: Pointer :: address_is_null

Is the address behind this Object at NULL?
fun append(key: String)

curl :: CURLSList :: append

Append an element in the linked list
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
fun destroy

curl :: CURLSList :: destroy

Release allocated memory
fun free

core :: Pointer :: free

Free the memory pointed by this pointer
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
fun is_init: Bool

curl :: CURLSList :: is_init

Check for initialization
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
init nul: Pointer

core :: Pointer :: nul

C NULL pointer
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
fun to_a: Array[String]

curl :: CURLSList :: to_a

Convert current low level List to an Array[String] object
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
init with_str(s: String): CURLSList

curl :: CURLSList :: with_str

Constructor allow us to get list instancied by appending an element inside.
package_diagram curl::CURLSList CURLSList core::Pointer Pointer curl::CURLSList->core::Pointer core::Object Object core::Pointer->core::Object ...core::Object ... ...core::Object->core::Object

Ancestors

interface Object

core :: Object

The root of the class hierarchy.

Parents

extern class Pointer

core :: Pointer

Pointer classes are used to manipulate extern C structures.

Class definitions

curl $ CURLSList
# Extern Type of the Linked list type of CURL
extern class CURLSList `{ struct curl_slist * `}
	# Empty constructor which allow us to avoid the use of Nit NULLABLE type
	private new `{ return NULL; `}

	# Constructor allow us to get list instancied by appending an element inside.
	new with_str(s: String) import String.to_cstring `{
		struct curl_slist *l = NULL;
		l = curl_slist_append(l, String_to_cstring(s));
		return l;
	`}

	# Check for initialization
	fun is_init: Bool `{ return (self != NULL); `}

	# Append an element in the linked list
	fun append(key: String) import String.to_cstring `{
		 char *k = String_to_cstring(key);
		 curl_slist_append(self, (char*)k);
	`}

	# Internal method to check for reachability of current data
	private fun native_data_reachable(c: CURLSList): Bool `{ return (c != NULL && c->data != NULL); `}

	# Internal method to check for reachability of next element
	private fun native_next_reachable(c: CURLSList): Bool `{ return (c != NULL && c->next != NULL); `}

	# Internal method to get current data
	private fun native_data(c: CURLSList): String import CString.to_s `{ return CString_to_s(c->data); `}

	# Internal method to get next element
	private fun native_next(c: CURLSList): CURLSList `{ return c->next; `}

	# Convert current low level List to an Array[String] object
	fun to_a: Array[String]
	do
		var r = new Array[String]
		var cursor = self
		loop
			if not native_data_reachable(cursor) then break
			r.add(native_data(cursor))
			cursor = native_next(cursor)
		end
		return r
	end

	# Release allocated memory
	fun destroy `{ curl_slist_free_all(self); `}
end
lib/curl/native_curl.nit:287,1--335,3