EVOLUTION-MANAGER
Edit File: curlOptions.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Constructor and accessors for CURLOptions objects</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for curlOptions {RCurl}"><tr><td>curlOptions {RCurl}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Constructor and accessors for CURLOptions objects</h2> <h3>Description</h3> <p>These functions provide a constructor and accessor methods for the (currently S3) class <code>CURLOptions</code>. This class is a way to group and manage options settings for CURL. These functions manage a named list of options where the names are elements of a fixed. Not all elements need be set, but these functions take care of expanding names to match the fixed set, while allowing callers to use abbreviated/partial names. Names that do not match (via <code><a href="../../base/html/pmatch.html">pmatch</a></code>) will cause an error. </p> <p>The set of possible names is given by <code>names(getCurlOptionsConstants())</code> or more directly with <code>listCurlOptions()</code>. </p> <p><code>mapCurlOptNames</code> handles the partial matching and expansion of the names of the options for all the functions that handle CURL options. Currently this uses <code><a href="../../base/html/pmatch.html">pmatch</a></code> to perform the matching and so rejects words that are ambiguous, i.e. have multiple matches within the set of permissible option names. As a result, "head" will match both "header" and "headerfunction". We may change this behavior in the future, but we encourage using the full names for readability of code if nothing else. </p> <h3>Usage</h3> <pre> curlOptions(..., .opts = list()) getCurlOptionsConstants() ## S3 replacement method for class 'CURLOptions' x[i] <- value ## S3 replacement method for class 'CURLOptions' x[[i]] <- value listCurlOptions() getCurlOptionTypes(opts = getCurlOptionsConstants()) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>...</code></td> <td> <p>name-value pairs identifying the settings for the options of interest.</p> </td></tr> <tr valign="top"><td><code>.opts</code></td> <td> <p>a named list of options, typically a previously created <code>CURLOptions</code> object. These are merged with the options specified in <code>...</code>.</p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>a <code>CURLOptions</code> object</p> </td></tr> <tr valign="top"><td><code>i</code></td> <td> <p>the name(s) of the option elements being accessed. These can be partial names matching elements in the set of known options. Other names will cause an error.</p> </td></tr> <tr valign="top"><td><code>value</code></td> <td> <p>the values to assign to the options identified via <code>i</code>.</p> </td></tr> <tr valign="top"><td><code>opts</code></td> <td> <p>the options whose type description are of interest in the call.</p> </td></tr> </table> <h3>Details</h3> <p>These functions use <code>mapCurlOptNames</code> to match and hence expand the names the callers provide. </p> <h3>Value</h3> <p><code>curlOptions</code> returns an object of class <code>CURLOptions</code> which is simply a named list. </p> <p><code>getCurlConstants</code> returns a named vector identifying the names of the possible options and their associated values. These values are used in the C code and also each integer encodes the type of the argument expected by the C code for that option. </p> <p><code>getCurlOptionTypes</code> returns human-readable, heuristic descriptions of the types expected for the different options. These are integer/logical corresponding to "long" in the RCurl documentation; string/object pointer corresponding to "char *" or ; function corresponding to a function/routine pointer; large number corresponding to a <code>curl_off_t</code>. </p> <h3>Author(s)</h3> <p>Duncan Temple Lang</p> <h3>References</h3> <p>Curl homepage <a href="http://curl.haxx.se">http://curl.haxx.se</a></p> <h3>See Also</h3> <p><code><a href="curlPerform.html">curlPerform</a></code> <code><a href="curlSetOpt.html">curlSetOpt</a></code> </p> <h3>Examples</h3> <pre> tt = basicTextGatherer() myOpts = curlOptions(verbose = TRUE, header = TRUE, writefunc = tt[[1]]) # note that the names are expanded, e.g. writefunc is now writefunction. names(myOpts) myOpts[["header"]] myOpts[["header"]] <- FALSE # Using the abbreviation "hea" is an error as it matches # both # myOpts[["hea"]] <- FALSE # Remove the option from the list myOpts[["header"]] <- NULL </pre> <hr /><div style="text-align: center;">[Package <em>RCurl</em> version 1.98-1.2 <a href="00Index.html">Index</a>]</div> </body></html>