1 29 30 package com.caucho.quercus.resources; 31 32 import com.caucho.quercus.env.*; 33 34 37 public class StreamContextResource extends ResourceValue { 38 private ArrayValue _options; 39 private ArrayValue _parameters; 40 41 public StreamContextResource() 42 { 43 this(null); 44 } 45 46 public StreamContextResource(ArrayValue options) 47 { 48 this(options, null); 49 } 50 51 public StreamContextResource(ArrayValue options, ArrayValue parameters) 52 { 53 if (options == null) 54 options = new ArrayValueImpl(); 55 56 if (parameters == null) 57 parameters = new ArrayValueImpl(); 58 59 _options = options; 60 _parameters = parameters; 61 } 62 63 66 public ArrayValue getOptions() 67 { 68 return _options; 69 } 70 71 74 public void setOptions(ArrayValue options) 75 { 76 _options = options; 77 } 78 79 82 public void setOption(String wrapper, String option, Value value) 83 { 84 StringValue wrapperV = new StringValueImpl(wrapper); 85 StringValue optionV = new StringValueImpl(option); 86 87 _options.getArray(wrapperV).put(optionV, value); 88 } 89 90 93 public void setParameters(ArrayValue parameters) 94 { 95 _parameters = parameters; 96 } 97 98 102 public StringValue toString(Env env) 103 { 104 return new StringValueImpl("StreamContextResource[]"); 105 } 106 } 107 108 | Popular Tags |