@@ -76,7 +76,7 @@ function set($key, $value)
7676
7777 /**
7878 * @param string $key The key of the object to get
79- * @return bdict|blist|bstr|bint|null $value The object
79+ * @return bdict|blist|bstr|bint|bool $value The object
8080 *
8181 * This function will return a reference of the node
8282 * If you need a copy instead, please use get_copy()
@@ -87,7 +87,7 @@ function get($key)
8787
8888 /**
8989 * @param string $key The key of the object to get
90- * @return bdict|blist|bstr|bint|null $value The object
90+ * @return bdict|blist|bstr|bint|bool $value The object
9191 */
9292 function get_copy ($ key )
9393 {
@@ -109,6 +109,67 @@ function del($key)
109109 {
110110 }
111111
112+ /**
113+ * @param string $path The path of the object to set
114+ * @param bdict|blist|bstr|bint $value The object
115+ * @return bool
116+ *
117+ * the path is a series of slash split keys
118+ * for example,
119+ * set('key1/0', new bint(1))
120+ * will do
121+ * (bdict)[ "key1"(bstr) => (blist)[ 0 => 1(bint) ] ]
122+ * and if you want to use a slash in key, use
123+ * \/
124+ * instead, this could be sometimes confusing, pay attention to it
125+ *
126+ * what's more, if any parent of the object in the given path does not exist,
127+ * it will be automatically created
128+ * the type of the created parent determines on the format of the key
129+ * for example,
130+ * (bdict)[ ]
131+ * ⟱
132+ * set_path(key1/0', new bint(1))
133+ * ⟱
134+ * (bdict)[ "key1"(bstr) => (blist)[ 0 => 1(bint) ] ]
135+ *
136+ * (bdict)[ ]
137+ * ⟱
138+ * set_path('key1/index0', new bint(1))
139+ * ⟱
140+ * (bdict)[ "key1"(bstr) => (bdict)[ "index0"(bstr) => 1(bint) ] ]
141+ * so be careful if you want a bdict whose keys are integer-only strings
142+ */
143+ function set_path ($ path , $ value )
144+ {
145+ }
146+
147+ /**
148+ * @param string $path The path of the object to get
149+ * @return bdict|blist|bstr|bint|bool $value The object
150+ *
151+ * This function will return a reference of the node
152+ * If you need a copy instead, please use get_path_copy()
153+ */
154+ function get_path ($ path )
155+ {
156+ }
157+
158+ /**
159+ * @param string $path The path of the object to get
160+ * @return bdict|blist|bstr|bint|bool $value The object
161+ */
162+ function get_path_copy ($ path )
163+ {
164+ }
165+
166+ /**
167+ * @param string $path The key of the object to delete
168+ * @return bool Deleted, true; not found, false
169+ */
170+ function del_path ($ path )
171+ {
172+ }
112173
113174 /**
114175 * @return int Return the length of encoded content
@@ -252,6 +313,43 @@ function del($key)
252313 {
253314 }
254315
316+ /**
317+ * @param string $path The path of the object to set
318+ * @param bdict|blist|bstr|bint $value The object
319+ * @return bool
320+ * @see bdict::set_path()
321+ */
322+ function set_path ($ path , $ value )
323+ {
324+ }
325+
326+ /**
327+ * @param string $path The path of the object to get
328+ * @return bdict|blist|bstr|bint|bool $value The object
329+ *
330+ * This function will return a reference of the node
331+ * If you need a copy instead, please use get_path_copy()
332+ */
333+ function get_path ($ path )
334+ {
335+ }
336+
337+ /**
338+ * @param string $path The path of the object to get
339+ * @return bdict|blist|bstr|bint|bool $value The object
340+ */
341+ function get_path_copy ($ path )
342+ {
343+ }
344+
345+ /**
346+ * @param string $path The key of the object to delete
347+ * @return bool Deleted, true; not found, false
348+ */
349+ function del_path ($ path )
350+ {
351+ }
352+
255353 /**
256354 * @return int Return the length of encoded content
257355 */
0 commit comments