Coconut Framework  beta
Classes | Functions
CNStringElement.h File Reference

Define CNStringElement class. More...

#include "CNForwarders.h"
#include <string.h>
#include <stdint.h>

Go to the source code of this file.

Classes

struct  CNStringElement
 

Functions

struct CNStringElementCNAllocateStringElement (size_t len, const unsigned char *str, struct CNResource *resource)
 Allocate string element. More...
 
struct CNStringElementCNCopyStringElement (const struct CNStringElement *src, struct CNResource *resource)
 Allocate a copy of source string element. More...
 
static void CNRetainStringElement (struct CNStringElement *dst)
 Retain the reference count of string element. More...
 
void CNReleaseStringElement (struct CNResource *resource, struct CNStringElement *dst)
 Release the reference count of string element. More...
 
unsigned char * CNContextOfStringElement (const struct CNStringElement *src)
 Get context of the string element. More...
 
static size_t CNContextLengthOfStringElement (const struct CNStringElement *src)
 Get context length of the string element. More...
 
static size_t CNMaxContextSizeOfStringElement (const struct CNStringElement *src)
 Get max context size of string elemnet. More...
 
struct CNMemoryProfile CNProfileOfStringElement (const struct CNStringElement *src)
 Get memory profile of string element. More...
 

Detailed Description

Define CNStringElement class.

Copyright
Copyright (C) 2012 Steel Wheels Project

Function Documentation

struct CNStringElement* CNAllocateStringElement ( size_t  len,
const unsigned char *  str,
struct CNResource *  resource 
)

Allocate string element.

Returns
Allocated string element
Parameters
lenLength of source string
strSource string
resourceResource to allocate this element
struct CNStringElement* CNCopyStringElement ( const struct CNStringElement src,
struct CNResource *  resource 
)

Allocate a copy of source string element.

Returns
New string element
Parameters
srcSource string element
resourceResource to allocate the string element
static void CNRetainStringElement ( struct CNStringElement dst)
inlinestatic

Retain the reference count of string element.

Parameters
dstDestination string element

References CNStringElement::referenceCount.

void CNReleaseStringElement ( struct CNResource *  resource,
struct CNStringElement dst 
)

Release the reference count of string element.

Parameters
resourceResource to release the element
dstDestination string element
unsigned char* CNContextOfStringElement ( const struct CNStringElement src)

Get context of the string element.

Returns
Context of the string
Parameters
srcSource string element
static size_t CNContextLengthOfStringElement ( const struct CNStringElement src)
inlinestatic

Get context length of the string element.

Returns
Length of context of string element
Parameters
srcSource string element

References CNStringElement::currentContextLength.

static size_t CNMaxContextSizeOfStringElement ( const struct CNStringElement src)
inlinestatic

Get max context size of string elemnet.

Returns
Max context size
Parameters
srcSource string element

References CNStringElement::maxContextSize.

struct CNMemoryProfile CNProfileOfStringElement ( const struct CNStringElement src)

Get memory profile of string element.

Returns
Profile of source string element
Parameters
srcSource string element