Gjsify LogoGjsify Logo

Hierarchy

  • Param

Index

Constructors

Properties

name: string

Methods

  • getContent(): object
  • Get the content of param. The content should be treated as read-only and not modified in any way.

    Returns object

  • getContentLength(): number
  • getContentType(): string
  • Get the MIME type of the parameter. For example, basic strings have the MIME type "text/plain".

    Returns string

  • getFileName(): string
  • Get the original file name of the parameter, if one is available.

    Returns string

  • getName(): string
  • isString(): boolean
  • Determine if the parameter is a string value, i.e. the content type is "text/plain".

    Returns boolean

  • unref(): void
  • Decrease the reference count on param, destroying it if the reference count reaches 0.

    Returns void

  • newFull(name: string, use: Rest.MemoryUse, data: Uint8Array, contentType: string, filename: string): Rest.Param
  • Create a new #RestParam called name with length bytes of data as the value. content_type is the type of the data as a MIME type, for example "text/plain" for simple string parameters.

    If the parameter is a file upload it can be passed as filename.

    Parameters

    • name: string

      the parameter name

    • use: Rest.MemoryUse

      the #RestMemoryUse describing how the memory can be used

    • data: Uint8Array

      a pointer to the start of the data

    • contentType: string

      the content type of the data

    • filename: string

      the original filename, or %NULL

    Returns Rest.Param

  • A convience constructor to create a #RestParam from a given UTF-8 string. The resulting #RestParam will have a content type of "text/plain".

    Parameters

    • name: string

      the parameter name

    • use: Rest.MemoryUse

      the #RestMemoryUse describing how the memory can be used

    • string: string

      the parameter value

    Returns Rest.Param

  • newWithOwner(name: string, data: Uint8Array, contentType: string, filename: string, owner: object, ownerDnotify: GLib.DestroyNotify): Rest.Param
  • Create a new #RestParam called name with length bytes of data as the value. content_type is the type of the data as a MIME type, for example "text/plain" for simple string parameters.

    If the parameter is a file upload it can be passed as filename.

    When the #RestParam is freed, it will call owner_dnotify, passing owner to it. This allows you to do something like this:

    |[ GMappedFile *map = g_mapped_file_new (filename, FALSE, &error); RestParam *param = rest_param_new_with_owner ("media", g_mapped_file_get_contents (map), g_mapped_file_get_length (map), "image/jpeg", filename, map, (GDestroyNotify)g_mapped_file_unref);


    @constructor
    @param name the parameter name
    @param data a pointer to the start of the data
    @param contentType the content type of the data
    @param filename the original filename, or %NULL
    @param owner pointer to an object that owns `data`
    @param ownerDnotify a function to free/unref `owner` when the buffer is freed

    Parameters

    • name: string
    • data: Uint8Array
    • contentType: string
    • filename: string
    • owner: object
    • ownerDnotify: GLib.DestroyNotify

    Returns Rest.Param

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method