mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
bug 853682 - rm some chromium keyboard stuff and a scoped_vector thing both of which we don't use r=bsmedberg
This commit is contained in:
parent
267ba377a4
commit
9f69527406
@ -1,16 +0,0 @@
|
||||
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef BASE_KEYBOARD_CODES_H_
|
||||
#define BASE_KEYBOARD_CODES_H_
|
||||
|
||||
#include "build/build_config.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include "base/keyboard_codes_win.h"
|
||||
#elif defined(OS_POSIX)
|
||||
#include "base/keyboard_codes_posix.h"
|
||||
#endif
|
||||
|
||||
#endif // BASE_KEYBOARD_CODES_H_
|
@ -1,208 +0,0 @@
|
||||
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
/*
|
||||
* Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com. All rights reserved.
|
||||
* Copyright (C) 2008, 2009 Google Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF USE, DATA, OR
|
||||
* PROFITS, OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef BASE_KEYBOARD_CODES_POSIX_H_
|
||||
#define BASE_KEYBOARD_CODES_POSIX_H_
|
||||
|
||||
namespace base {
|
||||
|
||||
enum {
|
||||
VKEY_BACK = 0x08,
|
||||
VKEY_TAB = 0x09,
|
||||
VKEY_CLEAR = 0x0C,
|
||||
VKEY_RETURN = 0x0D,
|
||||
VKEY_SHIFT = 0x10,
|
||||
VKEY_CONTROL = 0x11,
|
||||
VKEY_MENU = 0x12,
|
||||
VKEY_PAUSE = 0x13,
|
||||
VKEY_CAPITAL = 0x14,
|
||||
VKEY_KANA = 0x15,
|
||||
VKEY_HANGUL = 0x15,
|
||||
VKEY_JUNJA = 0x17,
|
||||
VKEY_FINAL = 0x18,
|
||||
VKEY_HANJA = 0x19,
|
||||
VKEY_KANJI = 0x19,
|
||||
VKEY_ESCAPE = 0x1B,
|
||||
VKEY_CONVERT = 0x1C,
|
||||
VKEY_NONCONVERT = 0x1D,
|
||||
VKEY_ACCEPT = 0x1E,
|
||||
VKEY_MODECHANGE = 0x1F,
|
||||
VKEY_SPACE = 0x20,
|
||||
VKEY_PRIOR = 0x21,
|
||||
VKEY_NEXT = 0x22,
|
||||
VKEY_END = 0x23,
|
||||
VKEY_HOME = 0x24,
|
||||
VKEY_LEFT = 0x25,
|
||||
VKEY_UP = 0x26,
|
||||
VKEY_RIGHT = 0x27,
|
||||
VKEY_DOWN = 0x28,
|
||||
VKEY_SELECT = 0x29,
|
||||
VKEY_PRINT = 0x2A,
|
||||
VKEY_EXECUTE = 0x2B,
|
||||
VKEY_SNAPSHOT = 0x2C,
|
||||
VKEY_INSERT = 0x2D,
|
||||
VKEY_DELETE = 0x2E,
|
||||
VKEY_HELP = 0x2F,
|
||||
VKEY_0 = 0x30,
|
||||
VKEY_1 = 0x31,
|
||||
VKEY_2 = 0x32,
|
||||
VKEY_3 = 0x33,
|
||||
VKEY_4 = 0x34,
|
||||
VKEY_5 = 0x35,
|
||||
VKEY_6 = 0x36,
|
||||
VKEY_7 = 0x37,
|
||||
VKEY_8 = 0x38,
|
||||
VKEY_9 = 0x39,
|
||||
VKEY_A = 0x41,
|
||||
VKEY_B = 0x42,
|
||||
VKEY_C = 0x43,
|
||||
VKEY_D = 0x44,
|
||||
VKEY_E = 0x45,
|
||||
VKEY_F = 0x46,
|
||||
VKEY_G = 0x47,
|
||||
VKEY_H = 0x48,
|
||||
VKEY_I = 0x49,
|
||||
VKEY_J = 0x4A,
|
||||
VKEY_K = 0x4B,
|
||||
VKEY_L = 0x4C,
|
||||
VKEY_M = 0x4D,
|
||||
VKEY_N = 0x4E,
|
||||
VKEY_O = 0x4F,
|
||||
VKEY_P = 0x50,
|
||||
VKEY_Q = 0x51,
|
||||
VKEY_R = 0x52,
|
||||
VKEY_S = 0x53,
|
||||
VKEY_T = 0x54,
|
||||
VKEY_U = 0x55,
|
||||
VKEY_V = 0x56,
|
||||
VKEY_W = 0x57,
|
||||
VKEY_X = 0x58,
|
||||
VKEY_Y = 0x59,
|
||||
VKEY_Z = 0x5A,
|
||||
VKEY_LWIN = 0x5B,
|
||||
VKEY_RWIN = 0x5C,
|
||||
VKEY_APPS = 0x5D,
|
||||
VKEY_SLEEP = 0x5F,
|
||||
VKEY_NUMPAD0 = 0x60,
|
||||
VKEY_NUMPAD1 = 0x61,
|
||||
VKEY_NUMPAD2 = 0x62,
|
||||
VKEY_NUMPAD3 = 0x63,
|
||||
VKEY_NUMPAD4 = 0x64,
|
||||
VKEY_NUMPAD5 = 0x65,
|
||||
VKEY_NUMPAD6 = 0x66,
|
||||
VKEY_NUMPAD7 = 0x67,
|
||||
VKEY_NUMPAD8 = 0x68,
|
||||
VKEY_NUMPAD9 = 0x69,
|
||||
VKEY_MULTIPLY = 0x6A,
|
||||
VKEY_ADD = 0x6B,
|
||||
VKEY_SEPARATOR = 0x6C,
|
||||
VKEY_SUBTRACT = 0x6D,
|
||||
VKEY_DECIMAL = 0x6E,
|
||||
VKEY_DIVIDE = 0x6F,
|
||||
VKEY_F1 = 0x70,
|
||||
VKEY_F2 = 0x71,
|
||||
VKEY_F3 = 0x72,
|
||||
VKEY_F4 = 0x73,
|
||||
VKEY_F5 = 0x74,
|
||||
VKEY_F6 = 0x75,
|
||||
VKEY_F7 = 0x76,
|
||||
VKEY_F8 = 0x77,
|
||||
VKEY_F9 = 0x78,
|
||||
VKEY_F10 = 0x79,
|
||||
VKEY_F11 = 0x7A,
|
||||
VKEY_F12 = 0x7B,
|
||||
VKEY_F13 = 0x7C,
|
||||
VKEY_F14 = 0x7D,
|
||||
VKEY_F15 = 0x7E,
|
||||
VKEY_F16 = 0x7F,
|
||||
VKEY_F17 = 0x80,
|
||||
VKEY_F18 = 0x81,
|
||||
VKEY_F19 = 0x82,
|
||||
VKEY_F20 = 0x83,
|
||||
VKEY_F21 = 0x84,
|
||||
VKEY_F22 = 0x85,
|
||||
VKEY_F23 = 0x86,
|
||||
VKEY_F24 = 0x87,
|
||||
VKEY_NUMLOCK = 0x90,
|
||||
VKEY_SCROLL = 0x91,
|
||||
VKEY_LSHIFT = 0xA0,
|
||||
VKEY_RSHIFT = 0xA1,
|
||||
VKEY_LCONTROL = 0xA2,
|
||||
VKEY_RCONTROL = 0xA3,
|
||||
VKEY_LMENU = 0xA4,
|
||||
VKEY_RMENU = 0xA5,
|
||||
VKEY_BROWSER_BACK = 0xA6,
|
||||
VKEY_BROWSER_FORWARD = 0xA7,
|
||||
VKEY_BROWSER_REFRESH = 0xA8,
|
||||
VKEY_BROWSER_STOP = 0xA9,
|
||||
VKEY_BROWSER_SEARCH = 0xAA,
|
||||
VKEY_BROWSER_FAVORITES = 0xAB,
|
||||
VKEY_BROWSER_HOME = 0xAC,
|
||||
VKEY_VOLUME_MUTE = 0xAD,
|
||||
VKEY_VOLUME_DOWN = 0xAE,
|
||||
VKEY_VOLUME_UP = 0xAF,
|
||||
VKEY_MEDIA_NEXT_TRACK = 0xB0,
|
||||
VKEY_MEDIA_PREV_TRACK = 0xB1,
|
||||
VKEY_MEDIA_STOP = 0xB2,
|
||||
VKEY_MEDIA_PLAY_PAUSE = 0xB3,
|
||||
VKEY_MEDIA_LAUNCH_MAIL = 0xB4,
|
||||
VKEY_MEDIA_LAUNCH_MEDIA_SELECT = 0xB5,
|
||||
VKEY_MEDIA_LAUNCH_APP1 = 0xB6,
|
||||
VKEY_MEDIA_LAUNCH_APP2 = 0xB7,
|
||||
VKEY_OEM_1 = 0xBA,
|
||||
VKEY_OEM_PLUS = 0xBB,
|
||||
VKEY_OEM_COMMA = 0xBC,
|
||||
VKEY_OEM_MINUS = 0xBD,
|
||||
VKEY_OEM_PERIOD = 0xBE,
|
||||
VKEY_OEM_2 = 0xBF,
|
||||
VKEY_OEM_3 = 0xC0,
|
||||
VKEY_OEM_4 = 0xDB,
|
||||
VKEY_OEM_5 = 0xDC,
|
||||
VKEY_OEM_6 = 0xDD,
|
||||
VKEY_OEM_7 = 0xDE,
|
||||
VKEY_OEM_8 = 0xDF,
|
||||
VKEY_OEM_102 = 0xE2,
|
||||
VKEY_PROCESSKEY = 0xE5,
|
||||
VKEY_PACKET = 0xE7,
|
||||
VKEY_ATTN = 0xF6,
|
||||
VKEY_CRSEL = 0xF7,
|
||||
VKEY_EXSEL = 0xF8,
|
||||
VKEY_EREOF = 0xF9,
|
||||
VKEY_PLAY = 0xFA,
|
||||
VKEY_ZOOM = 0xFB,
|
||||
VKEY_NONAME = 0xFC,
|
||||
VKEY_PA1 = 0xFD,
|
||||
VKEY_OEM_CLEAR = 0xFE,
|
||||
VKEY_UNKNOWN = 0
|
||||
};
|
||||
|
||||
} // namespace views
|
||||
|
||||
#endif // BASE_KEYBOARD_CODES_POSIX_H_
|
@ -1,184 +0,0 @@
|
||||
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef BASE_KEYBOARD_CODES_WIN_H_
|
||||
#define BASE_KEYBOARD_CODES_WIN_H_
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
namespace base {
|
||||
|
||||
enum {
|
||||
VKEY_BACK = VK_BACK,
|
||||
VKEY_TAB = VK_TAB,
|
||||
VKEY_CLEAR = VK_CLEAR,
|
||||
VKEY_RETURN = VK_RETURN,
|
||||
VKEY_SHIFT = VK_SHIFT,
|
||||
VKEY_CONTROL = VK_CONTROL,
|
||||
VKEY_MENU = VK_MENU,
|
||||
VKEY_PAUSE = VK_PAUSE,
|
||||
VKEY_CAPITAL = VK_CAPITAL,
|
||||
VKEY_KANA = VK_KANA,
|
||||
VKEY_HANGUL = VK_HANGUL,
|
||||
VKEY_JUNJA = VK_JUNJA,
|
||||
VKEY_FINAL = VK_FINAL,
|
||||
VKEY_HANJA = VK_HANJA,
|
||||
VKEY_KANJI = VK_KANJI,
|
||||
VKEY_ESCAPE = VK_ESCAPE,
|
||||
VKEY_CONVERT = VK_CONVERT,
|
||||
VKEY_NONCONVERT = VK_NONCONVERT,
|
||||
VKEY_ACCEPT = VK_ACCEPT,
|
||||
VKEY_MODECHANGE = VK_MODECHANGE,
|
||||
VKEY_SPACE = VK_SPACE,
|
||||
VKEY_PRIOR = VK_PRIOR,
|
||||
VKEY_NEXT = VK_NEXT,
|
||||
VKEY_END = VK_END,
|
||||
VKEY_HOME = VK_HOME,
|
||||
VKEY_LEFT = VK_LEFT,
|
||||
VKEY_UP = VK_UP,
|
||||
VKEY_RIGHT = VK_RIGHT,
|
||||
VKEY_DOWN = VK_DOWN,
|
||||
VKEY_SELECT = VK_SELECT,
|
||||
VKEY_PRINT = VK_PRINT,
|
||||
VKEY_EXECUTE = VK_EXECUTE,
|
||||
VKEY_SNAPSHOT = VK_SNAPSHOT,
|
||||
VKEY_INSERT = VK_INSERT,
|
||||
VKEY_DELETE = VK_DELETE,
|
||||
VKEY_HELP = VK_HELP,
|
||||
VKEY_0 = '0',
|
||||
VKEY_1 = '1',
|
||||
VKEY_2 = '2',
|
||||
VKEY_3 = '3',
|
||||
VKEY_4 = '4',
|
||||
VKEY_5 = '5',
|
||||
VKEY_6 = '6',
|
||||
VKEY_7 = '7',
|
||||
VKEY_8 = '8',
|
||||
VKEY_9 = '9',
|
||||
VKEY_A = 'A',
|
||||
VKEY_B = 'B',
|
||||
VKEY_C = 'C',
|
||||
VKEY_D = 'D',
|
||||
VKEY_E = 'E',
|
||||
VKEY_F = 'F',
|
||||
VKEY_G = 'G',
|
||||
VKEY_H = 'H',
|
||||
VKEY_I = 'I',
|
||||
VKEY_J = 'J',
|
||||
VKEY_K = 'K',
|
||||
VKEY_L = 'L',
|
||||
VKEY_M = 'M',
|
||||
VKEY_N = 'N',
|
||||
VKEY_O = 'O',
|
||||
VKEY_P = 'P',
|
||||
VKEY_Q = 'Q',
|
||||
VKEY_R = 'R',
|
||||
VKEY_S = 'S',
|
||||
VKEY_T = 'T',
|
||||
VKEY_U = 'U',
|
||||
VKEY_V = 'V',
|
||||
VKEY_W = 'W',
|
||||
VKEY_X = 'X',
|
||||
VKEY_Y = 'Y',
|
||||
VKEY_Z = 'Z',
|
||||
VKEY_LWIN = VK_LWIN,
|
||||
VKEY_RWIN = VK_RWIN,
|
||||
VKEY_APPS = VK_APPS,
|
||||
VKEY_SLEEP = VK_SLEEP,
|
||||
VKEY_NUMPAD0 = VK_NUMPAD0,
|
||||
VKEY_NUMPAD1 = VK_NUMPAD1,
|
||||
VKEY_NUMPAD2 = VK_NUMPAD2,
|
||||
VKEY_NUMPAD3 = VK_NUMPAD3,
|
||||
VKEY_NUMPAD4 = VK_NUMPAD4,
|
||||
VKEY_NUMPAD5 = VK_NUMPAD5,
|
||||
VKEY_NUMPAD6 = VK_NUMPAD6,
|
||||
VKEY_NUMPAD7 = VK_NUMPAD7,
|
||||
VKEY_NUMPAD8 = VK_NUMPAD8,
|
||||
VKEY_NUMPAD9 = VK_NUMPAD9,
|
||||
VKEY_MULTIPLY = VK_MULTIPLY,
|
||||
VKEY_ADD = VK_ADD,
|
||||
VKEY_SEPARATOR = VK_SEPARATOR,
|
||||
VKEY_SUBTRACT = VK_SUBTRACT,
|
||||
VKEY_DECIMAL = VK_DECIMAL,
|
||||
VKEY_DIVIDE = VK_DIVIDE,
|
||||
VKEY_F1 = VK_F1,
|
||||
VKEY_F2 = VK_F2,
|
||||
VKEY_F3 = VK_F3,
|
||||
VKEY_F4 = VK_F4,
|
||||
VKEY_F5 = VK_F5,
|
||||
VKEY_F6 = VK_F6,
|
||||
VKEY_F7 = VK_F7,
|
||||
VKEY_F8 = VK_F8,
|
||||
VKEY_F9 = VK_F9,
|
||||
VKEY_F10 = VK_F10,
|
||||
VKEY_F11 = VK_F11,
|
||||
VKEY_F12 = VK_F12,
|
||||
VKEY_F13 = VK_F13,
|
||||
VKEY_F14 = VK_F14,
|
||||
VKEY_F15 = VK_F15,
|
||||
VKEY_F16 = VK_F16,
|
||||
VKEY_F17 = VK_F17,
|
||||
VKEY_F18 = VK_F18,
|
||||
VKEY_F19 = VK_F19,
|
||||
VKEY_F20 = VK_F20,
|
||||
VKEY_F21 = VK_F21,
|
||||
VKEY_F22 = VK_F22,
|
||||
VKEY_F23 = VK_F23,
|
||||
VKEY_F24 = VK_F24,
|
||||
VKEY_NUMLOCK = VK_NUMLOCK,
|
||||
VKEY_SCROLL = VK_SCROLL,
|
||||
VKEY_LSHIFT = VK_LSHIFT,
|
||||
VKEY_RSHIFT = VK_RSHIFT,
|
||||
VKEY_LCONTROL = VK_LCONTROL,
|
||||
VKEY_RCONTROL = VK_RCONTROL,
|
||||
VKEY_LMENU = VK_LMENU,
|
||||
VKEY_RMENU = VK_RMENU,
|
||||
VKEY_BROWSER_BACK = VK_BROWSER_BACK,
|
||||
VKEY_BROWSER_FORWARD = VK_BROWSER_FORWARD,
|
||||
VKEY_BROWSER_REFRESH = VK_BROWSER_REFRESH,
|
||||
VKEY_BROWSER_STOP = VK_BROWSER_STOP,
|
||||
VKEY_BROWSER_SEARCH = VK_BROWSER_SEARCH,
|
||||
VKEY_BROWSER_FAVORITES = VK_BROWSER_FAVORITES,
|
||||
VKEY_BROWSER_HOME = VK_BROWSER_HOME,
|
||||
VKEY_VOLUME_MUTE = VK_VOLUME_MUTE,
|
||||
VKEY_VOLUME_DOWN = VK_VOLUME_DOWN,
|
||||
VKEY_VOLUME_UP = VK_VOLUME_UP,
|
||||
VKEY_MEDIA_NEXT_TRACK = VK_MEDIA_NEXT_TRACK,
|
||||
VKEY_MEDIA_PREV_TRACK = VK_MEDIA_PREV_TRACK,
|
||||
VKEY_MEDIA_STOP = VK_MEDIA_STOP,
|
||||
VKEY_MEDIA_PLAY_PAUSE = VK_MEDIA_PLAY_PAUSE,
|
||||
VKEY_MEDIA_LAUNCH_MAIL = 0xB4,
|
||||
VKEY_MEDIA_LAUNCH_MEDIA_SELECT = 0xB5,
|
||||
VKEY_MEDIA_LAUNCH_APP1 = 0xB6,
|
||||
VKEY_MEDIA_LAUNCH_APP2 = 0xB7,
|
||||
VKEY_OEM_1 = VK_OEM_1,
|
||||
VKEY_OEM_PLUS = VK_OEM_PLUS,
|
||||
VKEY_OEM_COMMA = VK_OEM_COMMA,
|
||||
VKEY_OEM_MINUS = VK_OEM_MINUS,
|
||||
VKEY_OEM_PERIOD = VK_OEM_PERIOD,
|
||||
VKEY_OEM_2 = VK_OEM_2,
|
||||
VKEY_OEM_3 = VK_OEM_3,
|
||||
VKEY_OEM_4 = VK_OEM_4,
|
||||
VKEY_OEM_5 = VK_OEM_5,
|
||||
VKEY_OEM_6 = VK_OEM_6,
|
||||
VKEY_OEM_7 = VK_OEM_7,
|
||||
VKEY_OEM_8 = VK_OEM_8,
|
||||
VKEY_OEM_102 = VK_OEM_102,
|
||||
VKEY_PROCESSKEY = VK_PROCESSKEY,
|
||||
VKEY_PACKET = VK_PACKET,
|
||||
VKEY_ATTN = VK_ATTN,
|
||||
VKEY_CRSEL = VK_CRSEL,
|
||||
VKEY_EXSEL = VK_EXSEL,
|
||||
VKEY_EREOF = VK_EREOF,
|
||||
VKEY_PLAY = VK_PLAY,
|
||||
VKEY_ZOOM = VK_ZOOM,
|
||||
VKEY_NONAME = VK_NONAME,
|
||||
VKEY_PA1 = VK_PA1,
|
||||
VKEY_OEM_CLEAR = VK_OEM_CLEAR,
|
||||
VKEY_UNKNOWN = 0
|
||||
};
|
||||
|
||||
} // namespace views
|
||||
|
||||
#endif // BASE_KEYBOARD_CODES_WIN_H_
|
@ -1,52 +0,0 @@
|
||||
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef BASE_SCOPED_VECTOR_H_
|
||||
#define BASE_SCOPED_VECTOR_H_
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/stl_util-inl.h"
|
||||
|
||||
// ScopedVector wraps a vector deleting the elements from its
|
||||
// destructor.
|
||||
template <class T>
|
||||
class ScopedVector {
|
||||
public:
|
||||
typedef typename std::vector<T*>::iterator iterator;
|
||||
typedef typename std::vector<T*>::const_iterator const_iterator;
|
||||
|
||||
ScopedVector() {}
|
||||
~ScopedVector() { reset(); }
|
||||
|
||||
std::vector<T*>* operator->() { return &v; }
|
||||
const std::vector<T*>* operator->() const { return &v; }
|
||||
T* operator[](size_t i) { return v[i]; }
|
||||
const T* operator[](size_t i) const { return v[i]; }
|
||||
|
||||
bool empty() const { return v.empty(); }
|
||||
size_t size() const { return v.size(); }
|
||||
|
||||
iterator begin() { return v.begin(); }
|
||||
const_iterator begin() const { return v.begin(); }
|
||||
iterator end() { return v.end(); }
|
||||
const_iterator end() const { return v.end(); }
|
||||
|
||||
void push_back(T* elem) { v.push_back(elem); }
|
||||
|
||||
std::vector<T*>& get() { return v; }
|
||||
const std::vector<T*>& get() const { return v; }
|
||||
void swap(ScopedVector<T>& other) { v.swap(other.v); }
|
||||
void release(std::vector<T*>* out) { out->swap(v); v.clear(); }
|
||||
|
||||
void reset() { STLDeleteElements(&v); }
|
||||
|
||||
private:
|
||||
std::vector<T*> v;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ScopedVector);
|
||||
};
|
||||
|
||||
#endif // BASE_SCOPED_VECTOR_H_
|
Loading…
Reference in New Issue
Block a user